FIXME
이 핸들러에 진입하지 못하는 버그가 있는데, 이것은 아마도 LPTimer가 Low Power Mode에서 wake up 소스로 사용되고 있기 때문일 듯. 하지만 예제에서는 이것도 잘 되더라는 얘기. (아참, 그땐 wake up하지 않나?) 만약 안 되면 LLW_IRQHandler() 함수 내에서 필요한 걸 하든지, 그렇지 않으면 깨어난 후 메인루프 내에서 뭔가 하든지…
void LPTimer_IRQHandler(void) { volatile unsigned int dummyread; if (MCM_CPO & MCM_CPO_CPOACK_MASK) { MCM_CPO &= ~MCM_CPO_CPOREQ_MASK; while (MCM_CPO & MCM_CPO_CPOACK_MASK); DEBUG_PRINTF(" \r\nLPTRM Interrupt pulled OUT of Compute Mode\r\n"); } SIM_SCGC5 |= SIM_SCGC5_LPTMR_MASK; DEBUG_PRINTF(" \r\n[lptmr_isr]\r\n"); // write 1 to TCF to clear the LPT timer compare flag LPTMR0_CSR |= LPTMR_CSR_TCF_MASK; LPTMR0_CSR = (LPTMR_CSR_TEN_MASK | LPTMR_CSR_TIE_MASK | LPTMR_CSR_TCF_MASK); // enable timer // enable interrupts // clear the flag /* wait for write to complete to before returning */ dummyread = LPTMR0_CSR; (void) dummyread; }














