AnsweredAssumed Answered

Help with macros C

Question asked by florijan japelj on Apr 16, 2013
Latest reply on Apr 16, 2013 by florijan japelj

Hi,

 

I have the following code:

 

#define SET_BIT(reg,bit_no)      reg |= (1<<bit_no)

#define TRANSMITTER_ENABLE_BIT   SCI2C2, 7

 

 

 

void main(void){

 

     SET_BIT(TRANSMITTER_ENABLE_BIT);

 

}

 

 

With this code I want to put two arguments SCI2C2 and 7 into SET_BIT() macro. But the compiler says that there is only one argument detected instead of two in the line SET_BIT(TRANSMITTER_ENABLE_BIT);.

 

Can someone please tell me how to pass two arguments to macro   SET_BIT() ?

 

Best regards,

Florijan

Outcomes