I have the following macros:
#define __IR( x ) ICU.IR[ IR ## x ].BIT.IR
#define _IR( x ) __IR( x )
#define IR( x , y ) _IR( _ ## x ## _ ## y )
I use it as follows:
IR(SCI7, RXI7) = 0;
It expands to:
ICU.IR[ IR_SCI7_RXI7 ].BIT.IR = 0
Instead of using SCI7and RXI7I would like to use sci(channel)and rxi(channel). So I tried to create the following macros:
#define _sci(x) SCI ## x
#define sci(x) _sci(x)
#define _rxi(x) RXI ## x
#define rxi(x) _rxi(x)
#define channel 7
And then:
IR(sci(channel), rxi(channel)) = 0;
But that did not work. The compiler returns me:
Error [Pe017]: expected a "]"
I also tried with other manners, but to no avail.
What am I doing wrong?
source
share