when I read the code in multiwii source (got from '
http://code.google.com/p/multiwii/downloads/list'). there exist such code in the def.h file:
.....
#define LEDPIN_PINMODE pinMode (13, OUTPUT);
#define LEDPIN_TOGGLE PINB |= 1<<5; //switch LEDPIN state (digital PIN 13)
#define LEDPIN_OFF PORTB &= ~(1<<5);
......
at them same time, there exist below statements in MultiWii_1_9.pde file:
...
for (r=0;r<repeat;r++) {
for(i=0;i<num;i++) {
LEDPIN_TOGGLE; //switch LEDPIN state
BUZZERPIN_ON;
delay(wait);
BUZZERPIN_OFF;
}
delay(60);
}
....
my question is: the PB13 is output mode, why the LEDPIN_TOGGLE macro is valid?
thank you.