Macro Concatenation
Posted: Fri Nov 20, 2015 11:55 am
This may not be the right group, but I had a question about using macro concatenation feature of the compiler.
I'm using v2.7.3 on a Nano. This is the code:
I get error 'PIN_HEARTBEAT_PIN_GPIO' not declared.
Why doesn't the 'p' in the macro get replaced with the number 12?
I'm using v2.7.3 on a Nano. This is the code:
Code: Select all
#define HEARTBEAT_PIN 12 // Heartbeat LED pin.
#define GPIO_FUNCTION(p) (PIN_ ## p ## _GPIO)
...
Pins[HEARTBEAT_PIN].function( GPIO_FUNCTION( HEARTBEAT_PIN ) );
Why doesn't the 'p' in the macro get replaced with the number 12?