mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2025-06-08 23:13:16 -04:00
Gracefully close bluetooth on device sleep
This commit is contained in:
parent
335c6cbc5c
commit
2ab1d4b1ac
1 changed files with 6 additions and 0 deletions
|
@ -1457,6 +1457,12 @@ void sleep_now() {
|
|||
pinMode(PIN_DISP_SLEEP, OUTPUT);
|
||||
digitalWrite(PIN_DISP_SLEEP, DISP_SLEEP_LEVEL);
|
||||
#endif
|
||||
#if HAS_BLUETOOTH
|
||||
if (bt_state == BT_STATE_CONNECTED) {
|
||||
bt_stop();
|
||||
delay(100);
|
||||
}
|
||||
#endif
|
||||
esp_sleep_enable_ext0_wakeup(PIN_WAKEUP, WAKEUP_LEVEL);
|
||||
esp_deep_sleep_start();
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue