/* * usermain.c (usermain) * User Main */ #include #include #include #define GPIOBase 0xe0028000 // IO0 #define IOPIN ((_UW *)(GPIOBase + 0x0000)) #define IOSET ((_UW *)(GPIOBase + 0x0004)) #define IODIR ((_UW *)(GPIOBase + 0x0008)) #define IOCLR ((_UW *)(GPIOBase + 0x000c)) #define PinConnectBase 0xe002c000 #define PINSEL(x) ((_UW *)(PinConnectBase + 0x0000 + (x) * 4)) #define LED_PIN (1 << 31) // LED @ P0.31 EXPORT INT usermain( void ) { *PINSEL(1) &= ~0xc0000000; // P0.31: GPIO *IODIR |= LED_PIN; // LED pin: output while (1) { *IOCLR = LED_PIN; // LED: on tk_dly_tsk(500); *IOSET = LED_PIN; // LED: off tk_dly_tsk(500); } // never return return 0; }