From 4ef368330d57fa1902c8246142b62a10cacd782f Mon Sep 17 00:00:00 2001 From: Guruth <1669916+Guruth@users.noreply.github.com> Date: Sun, 22 May 2022 11:40:08 +0200 Subject: [PATCH] Fixed Trigger released check for MultiModeDrive (cherry picked from commit 2a2e2a2091494e8257b5e558077ca7a3c2ac575f) --- Src/main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Src/main.c b/Src/main.c index e531a64..5a09b21 100644 --- a/Src/main.c +++ b/Src/main.c @@ -162,11 +162,14 @@ static uint32_t buzzerTimer_prev = 0; static uint32_t inactivity_timeout_counter; static MultipleTap MultipleTapBrake; // define multiple tap functionality for the Brake pedal -static uint16_t rate = RATE; +static uint16_t rate = RATE; // Adjustable rate to support multiple drive modes on startup + #ifdef MULTI_MODE_DRIVE - static uint16_t max_speed; static uint8_t drive_mode; + static uint16_t max_speed; #endif + + int main(void) { HAL_Init(); @@ -230,7 +233,7 @@ int main(void) { #ifdef MULTI_MODE_DRIVE // Wait until triggers are released - while((adc_buffer.l_rx2 + adc_buffer.l_tx2) <= (input1[0].min + input2[0].min)) { HAL_Delay(10); } + while((adc_buffer.l_rx2 + adc_buffer.l_tx2) >= (input1[0].min + input2[0].min)) { HAL_Delay(10); } #endif while(1) {