using SMC_SetPowerModeWait from isr

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

using SMC_SetPowerModeWait from isr

560 Views
tuomasaaltio
Contributor II

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);
}

Labels (1)
0 Kudos
Reply
1 Reply

423 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply