AnsweredAssumed Answered

TRK KEA8 How can I exit from sleep mode with KBI ?

Question asked by Ahn Joseph on Jun 18, 2017
Latest reply on Jun 22, 2017 by Kerry Zhou

Hi 

 

I had TRK KEA8 EVM 

 

I should be wake up from sleep mode with KBI 

But I can`t wake up from sleep mode 

 

Pls ref my code and let me know " How can I exit from sleep mode with KBI"

 

1st : I had setup "SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;" (For Sleep mode)

2nd : My code  is to enter sleep mode by SW2 input

 

The KBI IRQ Handler work well.  

       

void KBI1_IRQHandler()
{
KBI1_SC |= KBI_SC_KBACK_MASK; /*Clear flag*/
if((GPIOA_PDIR & GPIO_PDIR_PDI(0x100000))>>20) /* If SW1 has been pressed */
{

__asm("nop");

LED0_TOGGLE;

}
else if((GPIOA_PDIR & GPIO_PDIR_PDI(0x200000))>>21) /* If SW2 has been pressed *
{
__asm("nop");
__asm__("wfi");
__asm("nop");

}
}

Original Attachment has been moved to: KEA8_test.zip

Outcomes