Hi! I would like to use KEIL's C51 tools for Chipcons CC2430 instead of IAR's buggy IDE... What is the best way to port the Chipcons example files (from their website) writen for IAR's EW? Has someone allready done this and is there a downloadable conversion available? Chipcon's IAR deal seems to limit their support in this issue...
Always encapsulate your compiler-specifics in typedefs, #defines, etc... OR have compiler-specifics, and only compiler-specifics in a separate .h file Erik
"OR have compiler-specifics, and only compiler-specifics in a separate .h file" That's not an "OR" - that's an "AND"! You'd put all the definitions in the .h file and then use them throughout the code... eg, never use the Keil keyword extension 'xdata' directly - always use it via an XDATA macro, or whatever...
OR - AND, now we are talking logic "my" logic stem from the fact that i once were exposed to the worst mess i have ever seen where every 3rd line was encased in an #ifdef to make compiling across compilers possible. Going by Andys suggestion (which I support with my caveat) as stated you could do as the - i ... naah person that did the above. eg, never use the Keil keyword extension 'xdata' directly - always use it via an XDATA macro I go a bit further totally avoiding "split" definitions as e.g. unsigned char defined this way
#define U8 unsigned char #define S8 signed char #define UI8 unsigned char idata #define UX8 unsigned char xdata #define UC8 unsigned char code // pointer in data in #define U8DI unsigned char idata * data // data idata #define U8DX unsigned char xdata * data // data xdata #define U8IX unsigned char xdata * idata // idata xdata #define U8XX unsigned char xdata * xdata // xdata xdata #define U8IC unsigned char code * idata // idata code #define U8DC unsigned char code * data // data code #define U8XC unsigned char code * xdata // xdata code #define U8CC unsigned char code * code // code code