From 31439f20f79a4a87626668826214f9940b8017a5 Mon Sep 17 00:00:00 2001 From: Aiden Madaffri Date: Fri, 29 Sep 2023 11:18:28 -0500 Subject: [PATCH] Limit max motor speed to 20% in reverse --- Apps/Src/SendTritium.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Apps/Src/SendTritium.c b/Apps/Src/SendTritium.c index ba5b976c..cec0ff35 100644 --- a/Apps/Src/SendTritium.c +++ b/Apps/Src/SendTritium.c @@ -388,7 +388,7 @@ static void ReverseDriveHandler(){ UpdateDisplay_SetGear(DISP_REVERSE); } velocitySetpoint = -MAX_VELOCITY; - currentSetpoint = percentToFloat(map(accelPedalPercent, ACCEL_PEDAL_THRESHOLD, PEDAL_MAX, CURRENT_SP_MIN, CURRENT_SP_MAX)); + currentSetpoint = percentToFloat(map(accelPedalPercent, ACCEL_PEDAL_THRESHOLD, PEDAL_MAX, CURRENT_SP_MIN, CURRENT_SP_MAX * 0.2)); // Limit max motor speed to 20% in reverse cruiseEnable = false; onePedalEnable = false; } @@ -626,7 +626,7 @@ static void BrakeDecider(){ void Task_SendTritium(void *p_arg){ OS_ERR err; - // Initialize current state to FORWARD_DRIVE + // Initialize current state to NEUTRAL_DRIVE state = FSM[NEUTRAL_DRIVE]; prevState = FSM[NEUTRAL_DRIVE];