#include "LPC17xx.h"
#include <stdint.h>
volatile uint32_t msTicks = 0;
volatile uint32_t curTicks;
void SysTick_Handler(void)
{
msTicks++;
}
void Delay (unsigned long dlyTicks)
{
curTicks = msTicks;
while ((msTicks - curTicks) < dlyTicks);
}
int main (void)
{
SystemInit();
SysTick_Config(SystemCoreClock / 1000);
LPC_SC->PCONP |= ( 1 << 15 ); // power up GPIO
LPC_GPIO1->FIODIR |= 1 << 29; // puts P1.29 into output mode.
while(1)
{
LPC_GPIO1->FIOPIN |= 1 << 29; // make P1.29 high
Delay(500);
LPC_GPIO1->FIOPIN &= ~( 1 << 29 ); // make P1.29 low
Delay(500);
}
}