what is the correct way to enter low power mode from isr ?I'm using FRDM-KL25Z. My tpm isr doesn't work:
void TPM1_IRQHandler(void)
{
GPIO_SetPinsOutput( BOARD_DEBU_GPIO, 1u << BOARD_DEBU_GPIO_PIN );
//SMC_PreEnterWaitModes();
SMC_SetPowerModeWait(SMC);
//SMC_PostExitWaitModes();
GPIO_ClearPinsOutput( BOARD_DEBU_GPIO, 1u << BOARD_DEBU_GPIO_PIN );
/* Clear interrupt flag.*/
TPM_ClearStatusFlags(BOARD_TPM_BASEADDR, TPM_CHANNEL_FLAG | kTPM_TimeOverflowFlag);
}
Hi
I don't recommend enter into lower power mode in interrupt service routine.
It could set a flag in interrupt service routine and after exit the interrupt service routine check the flag to determine if enter into lower power mode or not.
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------