Rename variable

This commit is contained in:
Daniel Öster 2025-05-03 00:42:50 +03:00
parent 84a5fdf580
commit 576e8af921
4 changed files with 12 additions and 13 deletions

View file

@ -39,7 +39,6 @@ unsigned long negativeStartTime = 0;
unsigned long prechargeCompletedTime = 0;
unsigned long timeSpentInFaultedMode = 0;
#endif
static uint32_t timeSpentWithoutEnableTurnedOn = 0;
unsigned long currentTime = 0;
unsigned long lastPowerRemovalTime = 0;
unsigned long bmsPowerOnTime = 0;

View file

@ -12,7 +12,7 @@ static unsigned long previousMillis100ms = 0;
static uint32_t inverter_time = 0;
static uint16_t inverter_voltage = 0;
static int16_t inverter_current = 0;
static uint16_t secondsWithoutEnableSignal = 0;
static uint16_t timeWithoutInverterAllowsContactorClosing = 0;
#define THIRTY_MINUTES 1200
//Actual content messages
@ -150,13 +150,13 @@ void update_values_can_inverter() { //This function maps all the values fetched
// Check if Enable line is working. If we go too long without any input, raise an event
if (!datalayer.system.status.inverter_allows_contactor_closing) {
secondsWithoutEnableSignal++;
timeWithoutInverterAllowsContactorClosing++;
if (secondsWithoutEnableSignal > THIRTY_MINUTES) {
if (timeWithoutInverterAllowsContactorClosing > THIRTY_MINUTES) {
set_event(EVENT_NO_ENABLE_DETECTED, 0);
}
} else {
secondsWithoutEnableSignal = 0;
timeWithoutInverterAllowsContactorClosing = 0;
}
/*

View file

@ -12,7 +12,7 @@ static unsigned long previousMillis100ms = 0;
static uint32_t inverter_time = 0;
static uint16_t inverter_voltage = 0;
static int16_t inverter_current = 0;
static uint16_t secondsWithoutEnableSignal = 0;
static uint16_t timeWithoutInverterAllowsContactorClosing = 0;
#define THIRTY_MINUTES 1200
//Actual content messages
@ -154,13 +154,13 @@ void update_values_can_inverter() { //This function maps all the values fetched
// Check if Enable line is working. If we go too long without any input, raise an event
if (!datalayer.system.status.inverter_allows_contactor_closing) {
secondsWithoutEnableSignal++;
timeWithoutInverterAllowsContactorClosing++;
if (secondsWithoutEnableSignal > THIRTY_MINUTES) {
if (timeWithoutInverterAllowsContactorClosing > THIRTY_MINUTES) {
set_event(EVENT_NO_ENABLE_DETECTED, 0);
}
} else {
secondsWithoutEnableSignal = 0;
timeWithoutInverterAllowsContactorClosing = 0;
}
/*

View file

@ -33,7 +33,7 @@ static int16_t inverter_current = 0;
static bool pairing_completed = false;
static int16_t temperature_average = 0;
static uint16_t ampere_hours_remaining = 0;
static uint16_t secondsWithoutEnableSignal = 0;
static uint16_t timeWithoutInverterAllowsContactorClosing = 0;
#define THIRTY_MINUTES 1200
//Actual content messages
@ -152,13 +152,13 @@ void update_values_can_inverter() { //This function maps all the values fetched
// Check if Enable line is working. If we go too long without any input, raise an event
if (!datalayer.system.status.inverter_allows_contactor_closing) {
secondsWithoutEnableSignal++;
timeWithoutInverterAllowsContactorClosing++;
if (secondsWithoutEnableSignal > THIRTY_MINUTES) {
if (timeWithoutInverterAllowsContactorClosing > THIRTY_MINUTES) {
set_event(EVENT_NO_ENABLE_DETECTED, 0);
}
} else {
secondsWithoutEnableSignal = 0;
timeWithoutInverterAllowsContactorClosing = 0;
}
}