Rename Controller A/B -> Main CTRL / Inst. Cluster (user); Sleep when the car is off: Settings switch, deep sleep on quiet CAN + idle screen, CAN RX wake, switch mirrored to the cluster; docs
Firmware / build (push) Successful in 7m22s

This commit is contained in:
2026-09-28 16:38:13 +02:00
parent 7a74c02b20
commit 803af7568f
48 changed files with 400 additions and 156 deletions
+15
View File
@@ -18,6 +18,7 @@ static const char* NVS_NAMESPACE = "settings";
static const char* NVS_KEY_WIFI_ENABLED = "wifi_en";
static const char* NVS_KEY_UART_ENABLED = "uart_en";
static const char* NVS_KEY_DEBUG_ENABLED = "debug_en";
static const char* NVS_KEY_SLEEP_ENABLED = "sleep_en";
static const char* NVS_KEY_CAN_ENABLED = "can_en";
// ============================================================================
@@ -66,6 +67,20 @@ void saveDebugState(bool enabled) {
Serial.printf("[SettingsManager] Saved Debug state = %s\n", enabled ? "ON" : "OFF");
}
void saveSleepState(bool enabled) {
preferences.begin(NVS_NAMESPACE, false);
preferences.putBool(NVS_KEY_SLEEP_ENABLED, enabled);
preferences.end();
Serial.printf("[SettingsManager] Saved Sleep state = %s\n", enabled ? "ON" : "OFF");
}
bool loadSleepState() {
preferences.begin(NVS_NAMESPACE, true);
bool enabled = preferences.getBool(NVS_KEY_SLEEP_ENABLED, false);
preferences.end();
return enabled;
}
bool loadDebugState() {
preferences.begin(NVS_NAMESPACE, true); // read-only mode
bool enabled = preferences.getBool(NVS_KEY_DEBUG_ENABLED, false); // default: OFF