From 93315e142c621d74ecdc51cfbb1f0f9bee4e0973 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Thu, 10 Dec 2020 22:14:41 +0100 Subject: [PATCH] app irq off before sleep --- src/reset.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/reset.cpp b/src/reset.cpp index ff295baf..bd0284d7 100644 --- a/src/reset.cpp +++ b/src/reset.cpp @@ -91,6 +91,19 @@ void enter_deepsleep(const uint64_t wakeup_sec = 60, // stop further enqueuing of senddata sendTimer.detach(); + // shutdown MQTT safely +#ifdef HAS_MQTT +// to come +#endif + +// shutdown SPI safely +#ifdef HAS_SPI +// to come +#endif + + // halt interrupts accessing i2c bus + mask_user_IRQ(); + // switch off radio #if (BLECOUNTER) stop_BLEscan(); @@ -127,19 +140,6 @@ void enter_deepsleep(const uint64_t wakeup_sec = 60, SaveLMICToRTC(wakeup_sec); #endif // (HAS_LORA) -// shutdown MQTT safely -#ifdef HAS_MQTT -// to come -#endif - -// shutdown SPI safely -#ifdef HAS_SPI -// to come -#endif - - // halt interrupts accessing i2c bus - mask_user_IRQ(); - // switch off display #ifdef HAS_DISPLAY dp_shutdown();