From d098d6ada37931ac3625ebc58c634345a1b9d96e Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Tue, 6 Apr 2021 14:30:57 +0200 Subject: [PATCH] fix issue #781 --- src/reset.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reset.cpp b/src/reset.cpp index d8dcf153..56fbf98d 100644 --- a/src/reset.cpp +++ b/src/reset.cpp @@ -109,9 +109,6 @@ void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) { sds011_sleep(); #endif - // halt interrupts accessing i2c bus - mask_user_IRQ(); - // wait a while (max 100 sec) to clear send queues ESP_LOGI(TAG, "Waiting until send queues are empty..."); for (i = 100; i > 0; i--) { @@ -159,6 +156,9 @@ void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) { digitalWrite(EXT_POWER_SW, EXT_POWER_OFF); #endif + // halt interrupts accessing i2c bus + mask_user_IRQ(); + // shutdown i2c bus i2c_deinit();