Skip to main content
jg_spitfire
Senior
October 26, 2019
Question

Why is it necessary to disable interrupts before enter stop mode in BL072Z board end_node example?

  • October 26, 2019
  • 0 replies
  • 462 views
while( 1 ) 
 {
 
 if (AppProcessRequest==LORA_SET) 
 {
 
 /*reset notification flag*/
 
 AppProcessRequest=LORA_RESET;
 
 /*Send*/
 
 Send( NULL );
 }
 
 if (LoraMacProcessRequest==LORA_SET)
 {
 
 /*reset notification flag*/
 
 LoraMacProcessRequest=LORA_RESET;
 
 LoRaMacProcess( ); 
 }
 
 /*If a flag is set at this point, mcu must not enter low power and must loop*/
 
 DISABLE_IRQ( );
 
 /* if an interrupt has occurred after DISABLE_IRQ, it is kept pending 
 
 * and cortex will not enter low power anyway */
 
 if ((LoraMacProcessRequest!=LORA_SET) && (AppProcessRequest!=LORA_SET))
 
 {
 
#ifndef LOW_POWER_DISABLE
 
 LPM_EnterLowPower( );
 
#endif
 
 }
 
 ENABLE_IRQ();
 }

Hi, I don't understand why I need to disable the IRQ before enter stop mode and enable it when the board wakes up, if I comment those functions (DISABLE_IRQ and ENABLE_IRQ) the node does not send or receive data properly

Thanks

This topic has been closed for replies.