diff --git a/Software/Software.ino b/Software/Software.ino index c1745306..d1ff3964 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -102,8 +102,8 @@ State contactorStatus = DISCONNECTED; unsigned long prechargeStartTime = 0; unsigned long negativeStartTime = 0; unsigned long timeSpentInFaultedMode = 0; -uint8_t batteryAllowsContactorClosing = false; -uint8_t inverterAllowsContactorClosing = true; +bool batteryAllowsContactorClosing = false; +bool inverterAllowsContactorClosing = true; // Initialization void setup() { diff --git a/Software/src/battery/BMW-I3-BATTERY.h b/Software/src/battery/BMW-I3-BATTERY.h index 5e2c5e62..f39537ad 100644 --- a/Software/src/battery/BMW-I3-BATTERY.h +++ b/Software/src/battery/BMW-I3-BATTERY.h @@ -23,7 +23,7 @@ extern uint16_t stat_batt_power; extern uint16_t temperature_min; extern uint16_t temperature_max; extern uint16_t CANerror; -extern uint8_t batteryAllowsContactorClosing; +extern bool batteryAllowsContactorClosing; // Definitions for BMS status #define STANDBY 0 #define INACTIVE 1 diff --git a/Software/src/battery/IMIEV-CZERO-ION-BATTERY.h b/Software/src/battery/IMIEV-CZERO-ION-BATTERY.h index 17fc02b1..6f5f6d26 100644 --- a/Software/src/battery/IMIEV-CZERO-ION-BATTERY.h +++ b/Software/src/battery/IMIEV-CZERO-ION-BATTERY.h @@ -25,7 +25,7 @@ extern uint16_t temperature_max; extern uint16_t CANerror; extern uint16_t cell_max_voltage; extern uint16_t cell_min_voltage; -extern uint8_t batteryAllowsContactorClosing; +extern bool batteryAllowsContactorClosing; extern uint8_t LEDcolor; // Definitions for BMS status #define STANDBY 0 diff --git a/Software/src/battery/KIA-HYUNDAI-64-BATTERY.h b/Software/src/battery/KIA-HYUNDAI-64-BATTERY.h index 725def3e..0080dfa0 100644 --- a/Software/src/battery/KIA-HYUNDAI-64-BATTERY.h +++ b/Software/src/battery/KIA-HYUNDAI-64-BATTERY.h @@ -23,7 +23,7 @@ extern uint16_t stat_batt_power; extern uint16_t temperature_min; extern uint16_t temperature_max; extern uint16_t CANerror; -extern uint8_t batteryAllowsContactorClosing; +extern bool batteryAllowsContactorClosing; // Definitions for BMS status #define STANDBY 0 #define INACTIVE 1 diff --git a/Software/src/battery/NISSAN-LEAF-BATTERY.h b/Software/src/battery/NISSAN-LEAF-BATTERY.h index 32c4186d..176d7432 100644 --- a/Software/src/battery/NISSAN-LEAF-BATTERY.h +++ b/Software/src/battery/NISSAN-LEAF-BATTERY.h @@ -24,8 +24,8 @@ extern uint16_t temperature_min; //C+1, Goes thru convert2unsignedint16 funct extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 function (15.0C = 150, -15.0C = 65385) extern uint16_t cell_max_voltage; //mV, 0-4350 extern uint16_t cell_min_voltage; //mV, 0-4350 -extern uint8_t batteryAllowsContactorClosing; //Bool, 1=true, 0=false -extern uint8_t LEDcolor; //Enum, 0-2 +extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false +extern uint8_t LEDcolor; //Enum, 0-2 // Definitions for bms_status #define STANDBY 0 #define INACTIVE 1 diff --git a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp index 824b1a40..565ad9e0 100644 --- a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp +++ b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp @@ -71,7 +71,7 @@ static uint8_t packContactorSetState = 0; static uint8_t packCtrsClosingAllowed = 0; static uint8_t pyroTestInProgress = 0; static uint8_t send221still = 10; -static uint8_t LFP_Chemistry = false; +static bool LFP_Chemistry = false; //Fault codes static uint8_t WatchdogReset = 0; //Warns if the processor has experienced a reset due to watchdog reset. static uint8_t PowerLossReset = 0; //Warns if the processor has experienced a reset due to power loss. diff --git a/Software/src/inverter/SOFAR-CAN.h b/Software/src/inverter/SOFAR-CAN.h index ece158e8..c00ef0c8 100644 --- a/Software/src/inverter/SOFAR-CAN.h +++ b/Software/src/inverter/SOFAR-CAN.h @@ -20,8 +20,8 @@ extern uint16_t temperature_min; //C+1, Goes thru convert2unsignedint16 funct extern uint16_t temperature_max; //C+1, Goes thru convert2unsignedint16 function (15.0C = 150, -15.0C = 65385) extern uint16_t cell_max_voltage; //mV, 0-4350 extern uint16_t cell_min_voltage; //mV, 0-4350 -extern uint8_t batteryAllowsContactorClosing; //Bool, 1=true, 0=false -extern uint8_t LEDcolor; //Enum, 0-2 +extern bool batteryAllowsContactorClosing; //Bool, 1=true, 0=false +extern uint8_t LEDcolor; //Enum, 0-2 extern uint16_t min_voltage; extern uint16_t max_voltage; // Definitions for BMS status diff --git a/Software/src/inverter/SOLAX-CAN.h b/Software/src/inverter/SOLAX-CAN.h index 0857faf9..8da7b6c5 100644 --- a/Software/src/inverter/SOLAX-CAN.h +++ b/Software/src/inverter/SOLAX-CAN.h @@ -26,7 +26,7 @@ extern uint16_t min_voltage; extern uint16_t max_voltage; extern uint16_t cell_max_voltage; extern uint16_t cell_min_voltage; -extern uint8_t inverterAllowsContactorClosing; +extern bool inverterAllowsContactorClosing; // Timeout in milliseconds #define SolaxTimeout 2000