This commit is contained in:
cyberman54 2021-04-06 14:30:57 +02:00
parent 0b271f95b3
commit d098d6ada3

View File

@ -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();