对DSP2808的引脚操作的写法很不适应,今儿写了个宏:
#define pin_led1 GPIO9 #define pin_led2 GPIO8 #define pin_led3 GPIO7 #define pin_led4 GPIO19 //--------------------------------------------------------------------- #define pin_hi(x) GpioDataRegs.GPASET.bit.##x##=1 #define pin_lo(x) GpioDataRegs.GPACLEAR.bit.##x##=1 #define pin_cpl(x) GpioDataRegs.GPATOGGLE.bit.##x##=1
//--------------------------------------------------------------------- pin_cpl(pin_led1); 引脚取反 |