diff --git a/include/fw_reg_base.h b/include/fw_reg_base.h index f8c5cd8..a537c39 100644 --- a/include/fw_reg_base.h +++ b/include/fw_reg_base.h @@ -15,8 +15,25 @@ #ifndef __FW_REG_BASE_H__ #define __FW_REG_BASE_H__ -#if defined (SDCC) || defined (__SDCC) - +#if defined (__SDCC_SYNTAX_FIX) + #include + #include + # warning unrecognized compiler + #define __BIT bool + #define __IDATA + #define __PDATA + #define __XDATA + #define __CODE + #define __REENTRANT + #define SBIT(name, addr, bit) volatile bool name + #define SFR(name, addr) volatile unsigned char name + #define SFRX(addr) (*(unsigned char volatile *)(addr)) + #define SFR16X(addr) (*(unsigned char volatile *)(addr)) + #define INTERRUPT(name, vector) void name (void) + #define INTERRUPT_USING(name, vector, regnum) void name (void) + #define NOP() + +#elif defined (SDCC) || defined (__SDCC) #define __BIT __bit #define __IDATA __idata #define __PDATA __pdata @@ -34,7 +51,7 @@ #elif defined __CX51__ #define __BIT bit - #define __IDATA idata + #define __IDATA idata #define __PDATA pdata #define __XDATA xdata #define __CODE code @@ -49,24 +66,6 @@ extern void _nop_ (void); #define NOP() _nop_() -#else - #include - #include - # warning unrecognized compiler - #define __BIT bool - #define __IDATA - #define __PDATA - #define __XDATA - #define __CODE - #define __REENTRANT - #define SBIT(name, addr, bit) volatile bool name - #define SFR(name, addr) volatile unsigned char name - #define SFRX(addr) (*(unsigned char volatile *)(addr)) - #define SFR16X(addr) (*(unsigned char volatile *)(addr)) - #define INTERRUPT(name, vector) void name (void) - #define INTERRUPT_USING(name, vector, regnum) void name (void) - #define NOP() - #endif #define _P0 0x80