Hello, I used DAVE to get the basic setup for the twin-can module of an XC161.
In the suggested code I found some "funny" lines
#define CAN_TXIPNDL (*((uword volatile far *) 0x200288)) #define CAN_TXIPNDL_TXIPND0 ((T_Reg16 *) 0x200288)->bit0 if(CAN_TXIPNDL & CAN_TXIPNDL_TXIPND0) // message object 0 transmit interrupt { }
I thought CAN_TXIPNDL_TXIPND0 is already a bit variable. IMHO the boolean expression is nonsense. The following expression should give me the same result:
if(CAN_TXIPNDL_TXIPND0) { }
Just to be shure, am I right or not?
Leo