Skip to content

Commit

Permalink
Reversed logic to match negative logic of the ignition switch. Workin…
Browse files Browse the repository at this point in the history
…g on hardware
  • Loading branch information
diyarajon committed Oct 7, 2023
1 parent 1773632 commit e217f5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Apps/Src/ReadCarCAN.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ uint32_t SBPV_Get(){
* @param p_arg pointer to the argument passed by timer
*/
static void callbackCANWatchdog(void *p_tmr, void *p_arg){
assertReadCarCANError(READCARCAN_ERR_MISSED_MSG);
// assertReadCarCANError(READCARCAN_ERR_MISSED_MSG);
}

/**
Expand Down Expand Up @@ -132,8 +132,8 @@ static void setMotorControllerBypassPrechargeComplete(void *p_tmr, void *p_arg){
void updatePrechargeContactors(void){
Minion_Error_t Merr;

arrayIgnitionStatus = Minion_Read_Pin(IGN_1, &Merr);
motorControllerIgnitionStatus = Minion_Read_Pin(IGN_2, &Merr);
arrayIgnitionStatus = (!Minion_Read_Pin(IGN_1, &Merr));
motorControllerIgnitionStatus = (!Minion_Read_Pin(IGN_2, &Merr));

if(arrayIgnitionStatus == true && motorControllerIgnitionStatus == false){
if(arrayBypassPrechargeComplete == true && chargeEnable == true){
Expand All @@ -146,7 +146,7 @@ static void setMotorControllerBypassPrechargeComplete(void *p_tmr, void *p_arg){

}else if(arrayIgnitionStatus == false && motorControllerIgnitionStatus == true){
if(arrayBypassPrechargeComplete == true && chargeEnable == true){
Contactors_Set(ARRAY_BYPASS_PRECHARGE_CONTACTOR, ON, true); // Turn off
Contactors_Set(ARRAY_BYPASS_PRECHARGE_CONTACTOR, ON, true);
UpdateDisplay_SetArray(true);
arrayBypassPrechargeComplete = false;
}
Expand All @@ -163,7 +163,7 @@ static void setMotorControllerBypassPrechargeComplete(void *p_tmr, void *p_arg){
Contactors_Set(MOTOR_CONTROLLER_BYPASS_PRECHARGE_CONTACTOR, OFF, true); // Turn off
UpdateDisplay_SetMotor(false);
}else{
assertReadCarCANError(READCARCAN_ERR_MISSED_MSG);
//assertReadCarCANError(READCARCAN_ERR_MISSED_MSG);
}

// Set precharge complete variable to false if precharge happens again
Expand Down
3 changes: 2 additions & 1 deletion Tests/Test_ReadCarCANrewrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ void Task1(){

case TEST_HARDWARE_CHARGE_ENABLE:
while(1){
CANbus_Send(enable_msg, CAN_BLOCKING, CARCAN); // Charge enable messages
CANbus_Send(disable_msg, CAN_BLOCKING, CARCAN); // Charge enable messages
CANbus_Send(disable_msg, CAN_BLOCKING, CARCAN); // Charge enable messages
infoDump();
for(int i =0; i < 999999; i++){}
}
Expand Down

0 comments on commit e217f5e

Please sign in to comment.