mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
lots of changes:
* preflightSleep, notifySleep, notifyDeepSleep now allow arbitrary drivers/devices/software to register for sleep notification. * Use the proceeding to clean up MeshRadio - now the mesh radio is more like an independent driver that doesn't care so much about other systems * clean up MeshService so that it can work with zero MeshRadios added. This is a prelude to supporting boards with multiple interfaces (wifi, extra LORA radios etc) and allows development/testing in sim with a bare ESP32 board * Remove remaining ESP32 dependencies from the bare simulation target this allows running on anything that implements the arduino API
This commit is contained in:
12
src/sleep.h
12
src/sleep.h
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "Observer.h"
|
||||
#include "esp_sleep.h"
|
||||
|
||||
void doDeepSleep(uint64_t msecToWake);
|
||||
@@ -17,4 +18,13 @@ extern int bootCount;
|
||||
extern esp_sleep_source_t wakeCause;
|
||||
|
||||
// is bluetooth sw currently running?
|
||||
extern bool bluetoothOn;
|
||||
extern bool bluetoothOn;
|
||||
|
||||
/// Called to ask any observers if they want to veto sleep. Return 1 to veto or 0 to allow sleep to happen
|
||||
extern Observable<void *> preflightSleep;
|
||||
|
||||
/// Called to tell observers we are now entering (light or deep) sleep and you should prepare. Must return 0
|
||||
extern Observable<void *> notifySleep;
|
||||
|
||||
/// Called to tell observers we are now entering (deep) sleep and you should prepare. Must return 0
|
||||
extern Observable<void *> notifyDeepSleep;
|
||||
Reference in New Issue
Block a user