Skip to content

Commit

Permalink
Cell Balancing quick fix (#1286)
Browse files Browse the repository at this point in the history
### Changelist 

### Testing Done
tested with the BMS in the battery pack, discharging is working

### Resolved Tickets
<!-- Link any tickets that this PR resolves. -->

---------

Co-authored-by: will-chaba <[email protected]>
  • Loading branch information
DJ90864 and will-chaba authored May 30, 2024
1 parent 2cadbad commit 61a4b39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/quadruna/BMS/src/app/states/app_allStates.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool app_allStates_runOnTick100Hz(void)

const uint32_t cycles_to_measure =
balancing_enabled ? NUM_CYCLES_TO_MEASURE_BALANCING : NUM_CYCLES_TO_MEASURE_NOMINAL;
if (iso_spi_state_counter == cycles_to_measure)
if (iso_spi_state_counter >= cycles_to_measure)
{
iso_spi_state_counter = 0;
iso_spi_task_state = RUN_OPEN_WIRE_CHECK;
Expand Down
2 changes: 2 additions & 0 deletions firmware/quadruna/BMS/src/tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ _Noreturn void tasks_run1kHz(void)
static uint32_t start_ticks = 0;
start_ticks = osKernelGetTickCount();

hw_watchdog_checkIn(watchdog);

for (;;)
{
// Check in for timeouts for all RTOS tasks
Expand Down

0 comments on commit 61a4b39

Please sign in to comment.