mirror of
https://github.com/Laxilef/OTGateway.git
synced 2026-11-30 10:13:04 +05:00
refactor: define OTA upgrade flag and MQTT mutex inline
This commit is contained in:
1 parent
aa7385c70f
commit
cc6131eac9
7 files changed
+22
-27
No files matched your search
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <esp_log.h>
|
||||
#include <atomic>
|
||||
|
||||
#include "macros.h"
|
||||
#include "types.h"
|
||||
@@ -401,8 +400,4 @@ struct Variables {
|
||||
bool resetFault = false;
|
||||
bool resetDiagnostic = false;
|
||||
} actions;
|
||||
|
||||
struct {
|
||||
std::atomic<bool> upgrading{false};
|
||||
} states;
|
||||
};
|
||||
+3
-1
@@ -5,6 +5,7 @@
|
||||
#include <MycilaHADiscovery.h>
|
||||
#include <MycilaTaskManager.h>
|
||||
#include <esp_log.h>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
#include <memory>
|
||||
@@ -71,6 +72,7 @@ SettingResult fromJson(const JsonVariantConst src, Variables& dst);
|
||||
bool applyAction(std::string_view action, bool value);
|
||||
|
||||
// Application state and task managers
|
||||
inline std::atomic<bool> upgrading{false};
|
||||
extern Variables vars;
|
||||
extern TaskManager coreTaskManager;
|
||||
extern TaskManager systemTaskManager;
|
||||
@@ -107,7 +109,7 @@ extern AsyncWebServer* webServer;
|
||||
void initPortal();
|
||||
extern Task mqttConfigureTask;
|
||||
// Protect MQTT client and task pointers while checking and using them.
|
||||
extern std::mutex mqttMutex;
|
||||
inline std::mutex mqttMutex;
|
||||
extern Task* mqttPublishSettingsTask;
|
||||
extern Task* mqttPublishStateTask;
|
||||
extern Task* mqttPublishSensorsTask;
|
||||
|
||||
Reference in new issue
Block a user