Skip to content

Commit

Permalink
possible fixes to the issue
Browse files Browse the repository at this point in the history
  • Loading branch information
IshDeshpa committed Jul 17, 2024
1 parent 46fde7f commit 6df5d89
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 26 deletions.
20 changes: 2 additions & 18 deletions Apps/Src/SendTritium.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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

/**
Expand Down Expand Up @@ -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);
Expand Down
12 changes: 4 additions & 8 deletions Apps/Src/UpdateDisplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -298,7 +294,7 @@ void Task_UpdateDisplay(void *p_arg) {
}
}

componentVals[HEARTBEAT] = (componentVals[HEARTBEAT]?0:1);
UpdateDisplay_SetHearbeat(componentVals[HEARTBEAT]?0:1);

UpdateDisplay_Refresh();

Expand Down
Binary file modified Config/Display/display.HMI
Binary file not shown.

0 comments on commit 6df5d89

Please sign in to comment.