|
|
@@ -9,6 +9,7 @@
|
|
|
#include <map>
|
|
|
#include <string>
|
|
|
#include <mutex>
|
|
|
+#include <atomic>
|
|
|
#include "driver/gpio.h"
|
|
|
#include "freertos/queue.h"
|
|
|
#include "freertos/semphr.h"
|
|
|
@@ -88,7 +89,7 @@ public:
|
|
|
void taskHandler();
|
|
|
void gpioInterrupt(GpioResult* gpioResult);
|
|
|
void flashLightEnable(bool value);
|
|
|
- bool isEnabled() const { return _isEnabled; }
|
|
|
+ bool isEnabled() const { return _isEnabled.load(); }
|
|
|
#ifdef ENABLE_MQTT
|
|
|
void handleMQTTconnect();
|
|
|
#endif //ENABLE_MQTT
|
|
|
@@ -101,7 +102,7 @@ private:
|
|
|
QueueHandle_t _eventQueue = NULL;
|
|
|
TaskHandle_t _workerTask = NULL;
|
|
|
SemaphoreHandle_t _workerStopped = NULL;
|
|
|
- bool _isEnabled = false;
|
|
|
+ std::atomic<bool> _isEnabled{false};
|
|
|
|
|
|
int LEDNumbers = 2;
|
|
|
Rgb LEDColor = Rgb{ 255, 255, 255 };
|
|
|
@@ -112,7 +113,6 @@ private:
|
|
|
|
|
|
bool readConfig();
|
|
|
void clear();
|
|
|
- void clearUnlocked();
|
|
|
static void taskEntry(void *arg);
|
|
|
void workerLoop();
|
|
|
|