chore: Initial multi-core compatibility (#2294)

This commit is contained in:
Uri Tauber
2026-06-29 21:57:21 +03:00
committed by GitHub
parent 28255061fb
commit fd43ca2fe1
6 changed files with 40 additions and 13 deletions
+7
View File
@@ -3,9 +3,12 @@
#include <cstdint>
#include <iosfwd>
#include <mutex>
class CrossPointSettings {
private:
mutable std::mutex _mutex;
// Private constructor for singleton
CrossPointSettings() = default;
@@ -17,6 +20,10 @@ class CrossPointSettings {
CrossPointSettings(const CrossPointSettings&) = delete;
CrossPointSettings& operator=(const CrossPointSettings&) = delete;
// Access the settings mutex for protecting multi-field reads/writes from other cores.
// Callers must not re-enter SETTINGS methods that lock _mutex while holding it.
std::mutex& getMutex() const { return _mutex; }
enum SLEEP_SCREEN_MODE {
DARK = 0,
LIGHT = 1,