From 3eb5d68a48c7621c13c83507f3c7cfba11519801 Mon Sep 17 00:00:00 2001 From: Daniel Hansen Date: Sun, 7 Jun 2026 16:53:35 -0700 Subject: [PATCH 1/3] If the apps/bse violation occurs then sound the buzzer until it finishes plus 100 ms Signed-off-by: Daniel Hansen --- ECU/Application/Src/StateTicks.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ECU/Application/Src/StateTicks.c b/ECU/Application/Src/StateTicks.c index 18d3cf616..9201d4f8e 100644 --- a/ECU/Application/Src/StateTicks.c +++ b/ECU/Application/Src/StateTicks.c @@ -245,6 +245,9 @@ void ECU_Drive_Active(ECU_StateData *stateData) } if (APPS_BSE_Violation(stateData)) { + // FIXME Strongly illegal! We are not allowed to do this at all! EV.9.7.3 + buzzer_start_millis = millis_since_boot + MAX_BUZZER_TIME_MS - 100; + // FIXME Strongly illegal! We are not allowed to do this at all! EV.9.7.3 stateData->apps_bse_violation = true; } else if (CalcAccPedalTravel(stateData) < (stateData->apps_deadzone + 0.05f)) { stateData->apps_bse_violation = false; From dfb8fbc9f0e1928c02f05b7379796cb03bb8190f Mon Sep 17 00:00:00 2001 From: Daniel Hansen Date: Sun, 7 Jun 2026 19:16:14 -0700 Subject: [PATCH 2/3] Ensure brake lights stay on for 100ms at least Signed-off-by: Daniel Hansen --- ECU/Application/Src/Lights.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ECU/Application/Src/Lights.c b/ECU/Application/Src/Lights.c index 3e0e7c31d..ddd9eb07c 100644 --- a/ECU/Application/Src/Lights.c +++ b/ECU/Application/Src/Lights.c @@ -13,7 +13,13 @@ void BrakeLightControl(ECU_StateData *stateLump) { + static uint32_t brake_light_start_millis; + if (PressingBrake(stateLump)) { + brake_light_start_millis = MillisecondsSinceBoot(); + } + + if (MillisecondsSinceBoot() - brake_light_start_millis < 100) { LL_GPIO_SetOutputPin(BRAKE_LIGHT_GPIO_Port, BRAKE_LIGHT_Pin); } else { LL_GPIO_ResetOutputPin(BRAKE_LIGHT_GPIO_Port, BRAKE_LIGHT_Pin); From 8539b9e238104a8df2afe44a6a2e4e96b5c10867 Mon Sep 17 00:00:00 2001 From: Casey Zwicker Date: Sun, 7 Jun 2026 20:15:19 -0700 Subject: [PATCH 3/3] Run brake and dash lights during startup delay --- ECU/Application/Inc/Lights.h | 2 ++ ECU/Core/Src/main.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ECU/Application/Inc/Lights.h b/ECU/Application/Inc/Lights.h index 37e3b6626..08fa9658c 100644 --- a/ECU/Application/Inc/Lights.h +++ b/ECU/Application/Inc/Lights.h @@ -12,6 +12,8 @@ * * @return void */ +void BrakeLightControl(ECU_StateData *stateLump); +void dashLights(ECU_StateData *stateLump); void lightControl(ECU_StateData *stateData); #endif diff --git a/ECU/Core/Src/main.c b/ECU/Core/Src/main.c index 9ad6a31bb..3e1f442ea 100644 --- a/ECU/Core/Src/main.c +++ b/ECU/Core/Src/main.c @@ -485,6 +485,8 @@ int main(void) LOGOMATIC("Boot completed at %lu ms\n", MillisecondsSinceBoot()); while (MillisecondsSinceBoot() < 5000) { // Notes per Andrey and Ryan + BrakeLightControl(&stateLump); + dashLights(&stateLump); LL_mDelay(1); ADC_UpdateAnalogValues_EMA(ADC_buffers, NUM_SIGNALS, adc_alpha, ADC_outputs); write_adc_values_to_state_data();