Update TESLA-BATTERY.cpp

Change location of delay
This commit is contained in:
josiahhiggs 2024-12-26 13:02:35 +13:00
parent 3ef5bec6e2
commit fc90d3eca9

View file

@ -1198,6 +1198,9 @@ the first, for a few cycles, then stop all messages which causes the contactor
unsigned long currentMillis = millis(); unsigned long currentMillis = millis();
delay(
3000); // adding 3s delay to allow cell voltage min/max to be read before transmit_can to stop false under/over cell voltage events.
#if defined(TESLA_MODEL_SX_BATTERY) || defined(EXP_TESLA_BMS_DIGITAL_HVIL) #if defined(TESLA_MODEL_SX_BATTERY) || defined(EXP_TESLA_BMS_DIGITAL_HVIL)
if ((datalayer.system.status.inverter_allows_contactor_closing) && (datalayer.battery.status.bms_status != FAULT)) { if ((datalayer.system.status.inverter_allows_contactor_closing) && (datalayer.battery.status.bms_status != FAULT)) {
if (currentMillis - lastSend1CF >= 10) { if (currentMillis - lastSend1CF >= 10) {
@ -1226,9 +1229,6 @@ the first, for a few cycles, then stop all messages which causes the contactor
} }
#endif //defined(TESLA_MODEL_SX_BATTERY) || defined(EXP_TESLA_BMS_DIGITAL_HVIL) #endif //defined(TESLA_MODEL_SX_BATTERY) || defined(EXP_TESLA_BMS_DIGITAL_HVIL)
delay(
3000) // adding 3s delay to allow cell voltage min/max to be read before transmit_can to stop false under/over cell voltage events.
//Send 30ms message //Send 30ms message
if (currentMillis - previousMillis30 >= INTERVAL_30_MS) { if (currentMillis - previousMillis30 >= INTERVAL_30_MS) {
// Check if sending of CAN messages has been delayed too much. // Check if sending of CAN messages has been delayed too much.