diff --git a/esp32/.firmware/can_signals.h b/esp32/.firmware/can_signals.h index c33957d..7eca337 100644 --- a/esp32/.firmware/can_signals.h +++ b/esp32/.firmware/can_signals.h @@ -36,6 +36,7 @@ #define SIG_AP_UI_FSD_SELECTED_MASK 0x01u #define SIG_AP_FSD_ENABLE_BIT 46 +#define SIG_AP_CONTINUE_ON_GREEN_BIT 39 #define SIG_AP_NAG_CLEAR_BIT 19 #define SIG_AP_HW4_FSD_ENABLE_BIT 60 #define SIG_AP_HW4_EMERGENCY_VEHICLE_BIT 59 diff --git a/esp32/.firmware/fsd_handler.cpp b/esp32/.firmware/fsd_handler.cpp index 9b27417..0a28f7b 100644 --- a/esp32/.firmware/fsd_handler.cpp +++ b/esp32/.firmware/fsd_handler.cpp @@ -47,6 +47,7 @@ void fsd_state_init(FSDState *state, TeslaHWVersion hw) { state->ignore_ota = false; state->emergency_vehicle_detect = false; state->summon_unlock = false; // opt-in Summon EU Unlock, default OFF + state->continue_on_green = false; // opt-in Continue on Green, default OFF state->fsd_unlock = false; state->force_fsd = false; state->china_mode = false; @@ -203,6 +204,13 @@ bool fsd_handle_autopilot_frame(FSDState *state, CanFrame *frame) { // mux 0 is the authoritative "is FSD requested" mux if (mux == CAN_MUX_0) state->fsd_enabled = fsd_ui; + // bit39 continue-on-green with lead car (ev-open-can-tools TSLLC plugin); + // same 0x3FD mux0 frame on HW3/HW4, so apply before the HW split; pairs with TLSSC + if (mux == CAN_MUX_0 && state->continue_on_green && state->fsd_enabled) { + set_bit(frame, SIG_AP_CONTINUE_ON_GREEN_BIT, true); // bit39 continue-on-green + modified = true; + } + if (state->hw_version == TeslaHW_HW3) { // ── HW3 ────────────────────────────────────────────────────────────── if (mux == CAN_MUX_0 && state->fsd_unlock && state->fsd_enabled) { diff --git a/esp32/.firmware/prefs.cpp b/esp32/.firmware/prefs.cpp index aa1790f..cfdfccd 100644 --- a/esp32/.firmware/prefs.cpp +++ b/esp32/.firmware/prefs.cpp @@ -30,6 +30,7 @@ void prefs_load(FSDState *state) { state->precondition = g_prefs.getBool("precond",false); state->emergency_vehicle_detect = g_prefs.getBool("emrg", false); state->summon_unlock = g_prefs.getBool("summon", false); + state->continue_on_green = g_prefs.getBool("cog", false); state->bms_output = g_prefs.getBool("bms", false); state->firmware_14x_warning = g_prefs.getBool("14x", true); state->blackbox_enabled = g_prefs.getBool("bbx", BLACKBOX_DEFAULT_ENABLED); @@ -63,9 +64,10 @@ void prefs_load(FSDState *state) { state->cfg_steer_hi = g_prefs.getUChar("cshi", 1); state->cfg_steer_lo = g_prefs.getUChar("cslo", 0); - Serial.printf("[NVS] Loaded: FSDUnlock=%d NAG=%d ContinuousAP=%d IgnoreOTA=%d China=%d Chime=%d Summon=%d Sleep=%u AP=\"%s\" STA=\"%s\" HIDDEN=%d\n", + Serial.printf("[NVS] Loaded: FSDUnlock=%d NAG=%d ContinuousAP=%d IgnoreOTA=%d China=%d Chime=%d Summon=%d COG=%d Sleep=%u AP=\"%s\" STA=\"%s\" HIDDEN=%d\n", state->fsd_unlock, state->nag_killer, state->continuous_ap, state->ignore_ota, state->china_mode, state->suppress_speed_chime, state->summon_unlock, + state->continue_on_green, state->sleep_idle_ms, state->wifi_ssid, state->wifi_sta_ssid, state->wifi_hidden); g_prefs.end(); @@ -99,6 +101,7 @@ void prefs_save(const FSDState *state) { g_prefs.putBool("precond",state->precondition); g_prefs.putBool("emrg", state->emergency_vehicle_detect); g_prefs.putBool("summon", state->summon_unlock); + g_prefs.putBool("cog", state->continue_on_green); g_prefs.putBool("bms", state->bms_output); g_prefs.putBool("14x", state->firmware_14x_warning); g_prefs.putBool("bbx", state->blackbox_enabled); @@ -131,9 +134,10 @@ void prefs_save(const FSDState *state) { g_prefs.putUChar("cshi", state->cfg_steer_hi); g_prefs.putUChar("cslo", state->cfg_steer_lo); - Serial.printf("[NVS] Saved: FSDUnlock=%d NAG=%d ContinuousAP=%d IgnoreOTA=%d China=%d Chime=%d Summon=%d Sleep=%u AP=\"%s\" STA=\"%s\" HIDDEN=%d\n", + Serial.printf("[NVS] Saved: FSDUnlock=%d NAG=%d ContinuousAP=%d IgnoreOTA=%d China=%d Chime=%d Summon=%d COG=%d Sleep=%u AP=\"%s\" STA=\"%s\" HIDDEN=%d\n", state->fsd_unlock, state->nag_killer, state->continuous_ap, state->ignore_ota, state->china_mode, state->suppress_speed_chime, state->summon_unlock, + state->continue_on_green, state->sleep_idle_ms, state->wifi_ssid, state->wifi_sta_ssid, state->wifi_hidden); g_prefs.end(); diff --git a/esp32/.firmware/web_dashboard.cpp b/esp32/.firmware/web_dashboard.cpp index 40178c2..73802ce 100644 --- a/esp32/.firmware/web_dashboard.cpp +++ b/esp32/.firmware/web_dashboard.cpp @@ -499,6 +499,10 @@ input:checked+.sl2:before{transform:translateX(20px);background:#fff} Summon EU Unlock +
+ Continue on Green
pairs with TLSSC
+ +