mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Bug fix for PR#457 (disable send CAN when pause for update)
This commit is contained in:
parent
5dc413462b
commit
c1e67dae98
1 changed files with 10 additions and 2 deletions
|
@ -94,6 +94,8 @@ MyTimer connectivity_task_timer_10s(INTERVAL_10_S);
|
||||||
|
|
||||||
MyTimer loop_task_timer_10s(INTERVAL_10_S);
|
MyTimer loop_task_timer_10s(INTERVAL_10_S);
|
||||||
|
|
||||||
|
MyTimer check_pause_2s(INTERVAL_2_S);
|
||||||
|
|
||||||
// Contactor parameters
|
// Contactor parameters
|
||||||
#ifdef CONTACTOR_CONTROL
|
#ifdef CONTACTOR_CONTROL
|
||||||
enum State { DISCONNECTED, PRECHARGE, NEGATIVE, POSITIVE, PRECHARGE_OFF, COMPLETED, SHUTDOWN_REQUESTED };
|
enum State { DISCONNECTED, PRECHARGE, NEGATIVE, POSITIVE, PRECHARGE_OFF, COMPLETED, SHUTDOWN_REQUESTED };
|
||||||
|
@ -287,6 +289,10 @@ void core_loop(void* task_time_us) {
|
||||||
datalayer.system.status.time_cantx_us = 0;
|
datalayer.system.status.time_cantx_us = 0;
|
||||||
datalayer.system.status.core_task_10s_max_us = 0;
|
datalayer.system.status.core_task_10s_max_us = 0;
|
||||||
}
|
}
|
||||||
|
if (check_pause_2s.elapsed()) {
|
||||||
|
emulator_pause_state_send_CAN_battery();
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
vTaskDelayUntil(&xLastWakeTime, xFrequency);
|
vTaskDelayUntil(&xLastWakeTime, xFrequency);
|
||||||
}
|
}
|
||||||
|
@ -572,6 +578,7 @@ void receive_can_native() { // This section checks if we have a complete CAN me
|
||||||
|
|
||||||
void send_can() {
|
void send_can() {
|
||||||
|
|
||||||
|
if (can_send_CAN)
|
||||||
send_can_battery();
|
send_can_battery();
|
||||||
|
|
||||||
#ifdef CAN_INVERTER_SELECTED
|
#ifdef CAN_INVERTER_SELECTED
|
||||||
|
@ -579,6 +586,7 @@ void send_can() {
|
||||||
#endif // CAN_INVERTER_SELECTED
|
#endif // CAN_INVERTER_SELECTED
|
||||||
|
|
||||||
#ifdef CHARGER_SELECTED
|
#ifdef CHARGER_SELECTED
|
||||||
|
if (can_send_CAN)
|
||||||
send_can_charger();
|
send_can_charger();
|
||||||
#endif // CHARGER_SELECTED
|
#endif // CHARGER_SELECTED
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue