I was looking at contiki how it defines port direction for telob/sky: https://github.com/contiki-os/contiki/blob/master/cpu/msp430/dev/hwconf.h and am buffled.
I mean, in plain msp430 jurgon you could do this
P1DIR = 0x01;
to set up, for example, port 1 or
P1SEL &= (~BIT0); // Set P1.0 SEL for GPIO
Now, the contiki master programmer has something like:
#define HWCONF_PIN(name, port, bit) \
static CC_INLINE void name##_SELECT() {P##port##SEL &= ~(1 << bit);}
and so on..
to make programming the port easier but I can't figure out how this enternally gets executed.
For example, how is this " name##_SELECT()" called?
I know it's a newbie question but bear with me. Thanx