Hi, i tried to use these macros for simplified port definitions because i want to change only one line when i change the port (PANIC_PORT):
// standard macros (K&R A.12, C-FAQs 11.17) # define mc_CAT(x, y) x ## y # define mc_XCAT(x, y) mc_CAT(x, y) # define PANIC_PORT P3 # define PANIC_PORT_DIR mc_XCAT(PANIC_PORT,DIR) # define PANIC_PORT_SEL mc_XCAT(PANIC_PORT,SEL) # define PANIC_PORT_OUT mc_XCAT(PANIC_PORT,OUT) // line 35 and it almost works, but not for the out port, because OUT is defined as 0x0004: > msp430-gcc -mmcu=msp430x168 -O2 -Wall -g -c -o tmp.o tmp.c tmp.c: In function `kernel_panic': signal.c:35: `P30x0004' undeclared (first use in this function) Why is OUT defined? And can #undef OUT cause problems? Regards, Rolf
