move bluetooth code into something that is architecture specific...
because the ESP32 implementation will be different from NRF52 to make this possible I needed to decouple knowlege about bluetooth from our mesh service. Instead mesh service now uses the Obserable pattern to let any interested consumer get notified of important mesh changes (currently that is only bluetooth, but really we should do the same thing for decoupling the GUI 'app' from the mesh service) @girtsf would you mind reviewing my Observer changes? I haven't written C++ code in a long time ;-)
This commit is contained in:
+7
-2
@@ -1,7 +1,5 @@
|
||||
#include "sleep.h"
|
||||
#include "BluetoothUtil.h"
|
||||
#include "GPS.h"
|
||||
#include "MeshBluetoothService.h"
|
||||
#include "MeshRadio.h"
|
||||
#include "MeshService.h"
|
||||
#include "NodeDB.h"
|
||||
@@ -11,9 +9,14 @@
|
||||
#include "esp_pm.h"
|
||||
#include "main.h"
|
||||
#include "rom/rtc.h"
|
||||
#include "target_specific.h"
|
||||
#include <Wire.h>
|
||||
#include <driver/rtc_io.h>
|
||||
|
||||
#ifndef NO_ESP32
|
||||
#include "BluetoothUtil.h"
|
||||
#endif
|
||||
|
||||
#ifdef TBEAM_V10
|
||||
#include "axp20x.h"
|
||||
extern AXP20X_Class axp;
|
||||
@@ -105,7 +108,9 @@ void doDeepSleep(uint64_t msecToWake)
|
||||
// not using wifi yet, but once we are this is needed to shutoff the radio hw
|
||||
// esp_wifi_stop();
|
||||
|
||||
#ifndef NO_ESP32
|
||||
BLEDevice::deinit(false); // We are required to shutdown bluetooth before deep or light sleep
|
||||
#endif
|
||||
|
||||
screen.setOn(false); // datasheet says this will draw only 10ua
|
||||
|
||||
|
||||
Reference in New Issue
Block a user