Hello, I've got a small problem with the L166. In my project I have several C-files which use functions of osBoard.c. The functions are declared in osBoard.h. osBoard.h:
void saveContext(void); void restoreContext(void); void saveStatus(void); void restoreStatus(void); CPU_BIT getStatus(void); void setStatus(CPU_BIT statusregister); void setIEN(INT8U ien); INT8U getIEN(void); void enableInterrupts(void); void dissableInterrupts(void); void setSP(CPU_BIT); CPU_BIT getSP(void); void setInterruptLevel(INT8U ilvl); INT8U getInterruptLevel(void);
Thanks for the reply, but in this project I've two targets. When I compile the project for the C167 everything is just fine. The linker just nags with the XC167 target.
I found the problem. The problem was that in "osBoard.c" I had a
#ifdef C167 || XC167
Ever since 1989 (ANSI C), the preferred syntax has been #if defined(SYMBOL) rather than the K&R style #ifdef SYMBOL In this case, #if defined(A) || defined(B) would have worked just fine. This case of a compound expression was in fact one of the reasons motivating the change in syntax. It's impossible to drop support for #ifdef due to the large body of existing code, of course. But it seems that the new style has been slow to catch on, at best, and lots of new code still gets created with #ifdef rather than #if defined(), which just exacerbates the problem.