/** * Systick 1mS clock required for emWin time functions */ volatile uint32_t systick_timems; /* mSec delay */ static void lcdDelay(uint32_t delay) { delay += systick_timems; while (systick_timems < delay) {} } /** * @briefSystick handler * @returnNothing */ void SysTick_Handler(void) { systick_timems++; } int main(void) { // TODO: insert code here SystemCoreClockUpdate(); /* Enable and setup SysTick Timer at a periodic rate */ SysTick_Config(SystemCoreClock / 1000); Chip_GPIO_Init(LPC_GPIO_PORT); // Force the counter to be placed into memory volatile static int i = 0 ; Chip_SCU_PinMuxSet(0x7, 7, (SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN)); //GPIO3_15 func 0 Chip_SCU_PinMuxSet(0xA, 3, (SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN)); //GPIO4_10 func 0 Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 3, 15); Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 4, 10); Chip_SCU_PinMuxSet(0xE, 7, (SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN)); Chip_GPIO_SetPinDIROutput(LPC_GPIO_PORT, 7, 7); Chip_GPIO_SetPinOutHigh(LPC_GPIO_PORT, 3, 15); Chip_GPIO_SetPinOutHigh(LPC_GPIO_PORT, 4, 10); // Enter an infinite loop, just incrementing a counter while(1) { i++ ; lcdDelay(500); Chip_GPIO_SetPinToggle(LPC_GPIO_PORT, 7, 7); } |