From e2cac8f77d2dc5e98f4b9e73e4e54229da781959 Mon Sep 17 00:00:00 2001 From: lenvm Date: Tue, 14 Nov 2023 21:46:15 +0100 Subject: [PATCH] update uint8_t to bool --- Software/Software.ino | 4 ++-- Software/src/battery/BMW-I3-BATTERY.h | 2 +- Software/src/battery/IMIEV-CZERO-ION-BATTERY.h | 2 +- Software/src/battery/KIA-HYUNDAI-64-BATTERY.h | 2 +- Software/src/battery/NISSAN-LEAF-BATTERY.h | 4 ++-- Software/src/battery/TESLA-MODEL-3-BATTERY.cpp | 2 +- Software/src/inverter/SOFAR-CAN.h | 4 ++-- Software/src/inverter/SOLAX-CAN.h | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Software/Software.ino b/Software/Software.ino index fd9a9bcd..d1ec5b92 100644 --- a/Software/Software.ino +++ b/Software/Software.ino @@ -106,8 +106,8 @@ unsigned long prechargeStartTime = 0; unsigned long negativeStartTime = 0; unsigned long timeSpentInFaultedMode = 0; #endif -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 8e68a10f..e29f1c55 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