Skip to content

Commit 20b1c44

Browse files
committed
organize handles
1 parent e575208 commit 20b1c44

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

src/sp140/ble/ble_core.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
namespace {
1212

13-
class MyServerCallbacks : public BLEServerCallbacks {
13+
class BleServerConnectionCallbacks : public BLEServerCallbacks {
1414
void onConnect(BLEServer* server) override {
1515
deviceConnected = true;
1616
USBSerial.println("Device connected");
@@ -30,7 +30,7 @@ class MyServerCallbacks : public BLEServerCallbacks {
3030
void setupBLE() {
3131
BLEDevice::init("OpenPPG Controller");
3232
pServer = BLEDevice::createServer();
33-
pServer->setCallbacks(new MyServerCallbacks());
33+
pServer->setCallbacks(new BleServerConnectionCallbacks());
3434

3535
initConfigBleService(pServer);
3636
initBmsBleService(pServer);

src/sp140/sp140.ino

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,27 +94,23 @@ volatile bool uiReady = false;
9494

9595
SemaphoreHandle_t eepromSemaphore;
9696
SemaphoreHandle_t stateMutex;
97+
SemaphoreHandle_t lvglMutex;
9798

98-
// Add near other queue declarations
99-
QueueHandle_t bleStateQueue = NULL;
100-
QueueHandle_t deviceStateQueue = NULL;
101-
102-
// Add struct for BLE state updates
99+
// BLE state propagation
103100
struct BLEStateUpdate {
104101
uint8_t state;
105102
bool needsNotify;
106103
};
107-
108-
// Add new task handle
104+
QueueHandle_t bleStateQueue = NULL;
109105
TaskHandle_t bleStateUpdateTaskHandle = NULL;
106+
107+
// Device state broadcast
108+
QueueHandle_t deviceStateQueue = NULL;
110109
TaskHandle_t deviceStateUpdateTaskHandle = NULL;
111110

112-
// Add near other task handles
111+
// WebSerial worker
113112
TaskHandle_t webSerialTaskHandle = NULL;
114113

115-
// Add mutex for LVGL thread safety
116-
SemaphoreHandle_t lvglMutex;
117-
118114
// Variable to track the current screen page
119115
ScreenPage currentScreenPage = MAIN_SCREEN;
120116

0 commit comments

Comments
 (0)