当年调试LPC1343时使用的led闪烁程序
#include "LPC13xx.h" /* LPC13xx definitions */
#include "clkconfig.h"
#include "gpio.h"
#include "config.h"
#include "timer32.h"
int main (void) {
init_timer32(0, TIME_INTERVAL);
enable_timer32(0);
GPIOInit();
GPIOSetDir( LED_PORT, LED_BIT, 1 );
while (1)
{
if ( (timer32_0_counter%LED_TOGGLE_TICKS) < (LED_TOGGLE_TICKS/2) )
{
GPIOSetValue( LED_PORT, LED_BIT, LED_OFF );
} else
{
GPIOSetValue( LED_PORT, LED_BIT, LED_ON );
}
__WFI();
}
}