/* =============================================================================== Name : main.c Author : Version : Copyright : Copyright (C) Description : main definition =============================================================================== */ #ifdef __USE_CMSIS #include "LPC11xx.h" #endif #include #include // Variable to store CRP value in. Will be placed automatically // by the linker when "Enable Code Read Protect" selected. // See crp.h header for more information __CRP const unsigned int CRP_WORD = CRP_NO_CRP ; // TODO: insert other include files here // TODO: insert other definitions and declarations here //volatile uint32_t led_timer = 1000; // 1000ms volatile uint32_t led_timer = 500; // 1000ms int main(void) { volatile static uint32_t period; // set timer // TODO: insert code here LPC_IOCON->PIO1_5 = 0xd0; LPC_GPIO1->DIR |= (1<<5); // Enter an infinite loop, just incrementing a counter period = SystemCoreClock /1000; SysTick_Config(period); while(1); } // //SysTick // void SysTick_Handler(void){ static uint16_t count; if(++count >= led_timer){ LPC_GPIO1->DATA ^= (1 << 5); // Toggle count = 0; } }