Skip to content

Commit

Permalink
fix(balancing): stop balancing after TS ON
Browse files Browse the repository at this point in the history
  • Loading branch information
Tonidotpy committed Mar 8, 2024
1 parent b8047b9 commit 2cb3e81
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mainboard/Src/bms_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ bms_state_t do_idle(state_data_t *data) {
// Check for fatal errors
if (error_get_fatal() > 0)
next_state = STATE_FATAL_ERROR;
else if (_requested_ts_on() && feedback_is_ok(FEEDBACK_IDLE_MASK, FEEDBACK_IDLE_HIGH))
else if (_requested_ts_on() && feedback_is_ok(FEEDBACK_IDLE_MASK, FEEDBACK_IDLE_HIGH)) {
// Stop balancing
if (bal_is_balancing())
bal_stop();
next_state = STATE_WAIT_AIRN_CLOSE;
}

switch (next_state) {
case NO_CHANGE:
Expand Down Expand Up @@ -436,7 +440,7 @@ void close_airn(state_data_t *data) {
conv_debug.debug_signals_feedback_sd_in = 0;
conv_debug.debug_signals_feedback_sd_bms = 0;
conv_debug.debug_signals_feedback_sd_imd = 0;

// Set blinking led pattern
bms_set_led_blinker();

Expand Down Expand Up @@ -635,4 +639,4 @@ void _bms_handle_tim_oc_irq(TIM_HandleTypeDef *htim) {
default:
break;
}
}
}

0 comments on commit 2cb3e81

Please sign in to comment.