From 6df5d89663d1496899b9a457ca3c1f2973c763b1 Mon Sep 17 00:00:00 2001 From: IshDeshpa Date: Wed, 17 Jul 2024 17:57:47 -0500 Subject: [PATCH] possible fixes to the issue --- Apps/Src/SendTritium.c | 20 ++------------------ Apps/Src/UpdateDisplay.c | 12 ++++-------- Config/Display/display.HMI | Bin 10736346 -> 10736346 bytes 3 files changed, 6 insertions(+), 26 deletions(-) diff --git a/Apps/Src/SendTritium.c b/Apps/Src/SendTritium.c index fb9f36aa..bc95e325 100644 --- a/Apps/Src/SendTritium.c +++ b/Apps/Src/SendTritium.c @@ -232,7 +232,7 @@ static void readInputs(){ if(brakeSaturationCt < 3){ if(latest_pedal == 100) brakeSaturationCt++; - else if(latest_pedal == 0) brakeSaturationCt = 0; + else if(latest_pedal == 0 && brakeSaturationCt != 0) brakeSaturationCt--; brakePedalPercent = 0; } @@ -344,20 +344,6 @@ static uint8_t map(uint8_t input, uint8_t in_min, uint8_t in_max, uint8_t out_mi } } - -/** - * @brief Put the CONTROL_MODE message onto the CarCAN bus, detailing - * the current mode of control. -*/ -static void putControlModeCAN(){ - CANDATA_t message; - memset(&message, 0, sizeof(message)); - message.ID = CONTROL_MODE; - message.data[0] = state.name; - - SendCarCAN_Put(message); -} - // State Handlers & Deciders /** @@ -719,9 +705,7 @@ void Task_SendTritium(void *p_arg){ }else{ motorMsgCounter++; } - #endif - - putControlModeCAN(); + #endif // Delay of FSM_PERIOD ms OSTimeDlyHMSM(0, 0, 0, FSM_PERIOD, OS_OPT_TIME_HMSM_STRICT, &err); diff --git a/Apps/Src/UpdateDisplay.c b/Apps/Src/UpdateDisplay.c index 409174be..022723d1 100644 --- a/Apps/Src/UpdateDisplay.c +++ b/Apps/Src/UpdateDisplay.c @@ -126,7 +126,7 @@ static UpdateDisplayError_t UpdateDisplay_SetComponent(Component_t comp){ UpdateDisplayError_t ret = UPDATEDISPLAY_ERR_NONE; // For components that are on/off - if(comp <= MOTOR && componentVals[comp] <= 1){ + if(comp <= MOTOR){ DisplayCmd_t visCmd = { .compOrCmd = "vis", .attr = NULL, @@ -158,10 +158,6 @@ static UpdateDisplayError_t UpdateDisplay_SetComponent(Component_t comp){ ret = Display_Send(setCmd); return ret; } - else{ - assertUpdateDisplayError(UPDATEDISPLAY_ERR_PARSE_COMP); - return UPDATEDISPLAY_ERR_PARSE_COMP; - } return UPDATEDISPLAY_ERR_NONE; } @@ -250,7 +246,7 @@ UpdateDisplayError_t UpdateDisplay_SetBattTemperature(uint32_t val){ } UpdateDisplayError_t UpdateDisplay_SetBattCurrent(int32_t val){ - componentVals[PACK_CURRENT] = (((uint32_t)((val<0)?-val:val))/100); + componentVals[PACK_CURRENT] = (((val<0)?-val:val)/100); componentVals[PACK_CURR_SIGN] = (val < 0)?1:0; return UPDATEDISPLAY_ERR_NONE; } @@ -261,7 +257,7 @@ UpdateDisplayError_t UpdateDisplay_SetMCVoltage(uint32_t volts){ return UPDATEDISPLAY_ERR_NONE; } -UpdateDisplayError_t UpdateDisplay_SetMCCurrent(uint32_t val){ +UpdateDisplayError_t UpdateDisplay_SetMCCurrent(int32_t val){ componentVals[MC_BUS_CURRENT] = (val<0)?-val:val; componentVals[MC_CURR_SIGN] = (val < 0)?1:0; return UPDATEDISPLAY_ERR_NONE; @@ -298,7 +294,7 @@ void Task_UpdateDisplay(void *p_arg) { } } - componentVals[HEARTBEAT] = (componentVals[HEARTBEAT]?0:1); + UpdateDisplay_SetHearbeat(componentVals[HEARTBEAT]?0:1); UpdateDisplay_Refresh(); diff --git a/Config/Display/display.HMI b/Config/Display/display.HMI index 4baf6b72321f67e3434e1a16c1c96deb77dd969f..66e76aec9ce4b09411fb41ae84fa7d220d71ab2d 100755 GIT binary patch delta 860 zcmdVY-BZj_9LMqV+ji56u}KoEBu}AL5h)QBg*?R~MR`uDAE7)g=}o9qlJ#5|;}$iu z~x=9{WlAb`MI`fk5Ush++aL1{Ikhb`0<@% zq`)?VE@LcZy}vDQg8ApL@!O_Pp*5J{7>RU#Px$b))$4Bax-D@?ggC_|ks+^p!jE77 z+kNp6!&G9KMjX?LX9fw(WENg#lSmSCNMy?24HQsF5gXY=F(qtf3tK5=8{65zPIghoZua13FZ1 z5yngme-Blh(-`;odSa;3Zx16dNn{rFqw$99qjuL14qKWg zWrVWd4EaoypVg8OuND5@+n2kBGBMWme57}^FJ{Djha?zzi)C1j705$AR$>)aV+{(h7VEGc8&HUiD8eRe#ujYFHWZ@-+u=khc3|gy&6Xy< zBxwfmrrR7Oo;^^5jUi5@UU4dQO0B5!xGlowahnZJ#b*>%pIoC%bw($>MK_9d-RFe?r#6R(j`yxy@%FtduA-PxtLg}U(myk_ z?^s88x1~VpXkWal7;uH8Y*^vcFh$wyOv?{sV!l~aDBFf ziA)ihpf51#JzJn7;$sM>sQl)drpG~T`WCr&#qDyt_N%I4MJ{qv8SSFow1@W6KH5(Q z=pY@U!&FWcR7q8IgpLyE7*$gZ9j974L3LD5C&@#n$V&}$n$FN!I!EV8&;`0km*_HG Up{sO_u2Um5(T%op`^^H+PvF=CasU7T