void WKT_IRQHandler(void) { /* Clear WKT interrupt request */ Chip_WKT_ClearIntStatus(LPC_WKT); /* Wakeup IRQ handling here */ . . . } int main(void) { . . . /* Alarm/wake timer as chip wakeup source */ Chip_SYSCTL_EnablePeriphWakeup(SYSCTL_WAKEUP_WKTINT); /* Enable and reset WKT clock */ Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_WKT); Chip_SYSCTL_PeriphReset(RESET_WKT); /* 10KHz clock source */ Chip_WKT_SetClockSource(LPC_WKT, WKT_CLKSRC_10KHZ); /* Setup for wakeup in 5s */ Chip_WKT_LoadCount(LPC_WKT, Chip_WKT_GetClockRate(LPC_WKT) * 5); /* Tell PMU to go to sleep */ Chip_PMU_Sleep(LPC_PMU, PMU_MCU_DEEP_SLEEP); /* Will return here after wakeup and WKT IRQ */ Chip_WKT_Stop(LPC_WKT); . . . return 1; } |