AnsweredAssumed Answered

Cortex M4, low power mode

Question asked by Roosbeh Almasi on Feb 20, 2018
Latest reply on Feb 21, 2018 by Roosbeh Almasi

Hi every body,

 

this is going to be an easy one for most people I believe. 

the sleep functionality works fine, but I need to know this for something else. 

when the micro is in sleep mode (LLS), and it is woken up by an irq for instance a GPIO irq and set the event which fires the TASK B. where the code go first after wake up? what is the flow of the flow of the code  

does it go to the LLS isr then into GPIO isr or it is the other way around ? 

 

----------------- for example -------------------------

 

void task_A( )   // this task has lower priority to task B

{

   while (1)

    {

         do things;

         if (condition is met){

             WFI();            // goes into LLS sleep 

           }

        starts doing things again;

    }

 

}

 

 

void LLWU_IRQHandler( )        // LLS isr

{

    do the rigth things;

}

 

void  gpio_isr( )          // GPIO isr

{

   _lwevent_set(&event);   

}

 

 

 

void task_B( )   // this task has higher priority to task A

{

    while(1)

   {

        _lwevent_wait_ticks(&event);

         do stuff quickly;

        _lwevent_clear(&event);    

   }

}

 

 

 

thanks you 

Outcomes