Skip to content

Commit

Permalink
added mapping correction for configure_balancing (#100)
Browse files Browse the repository at this point in the history
* added mapping correction for configure_balancing

* added mapping correction for configure_balancing

* I think fixing it

---------

Co-authored-by: nwdepatie <nwdepatie@gmail.com>
  • Loading branch information
Sabramz and nwdepatie committed Apr 27, 2024
1 parent 3d18cdc commit 4072625
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Core/Src/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ void segment_configure_balancing(bool discharge_config[NUM_CHIPS][NUM_CELLS_PER_
{
for (int c = 0; c < NUM_CHIPS; c++) {
for (int cell = 0; cell < NUM_CELLS_PER_CHIP; cell++) {
if (discharge_config[c][cell])
discharge_commands[c] |= 1 << cell;
if (discharge_config[mapping_correction[c]][cell])
discharge_commands[mapping_correction[c]] |= 1 << cell;
else
discharge_commands[c] &= ~(1 << cell);
discharge_commands[mapping_correction[c]] &= ~(1 << cell);
}

configure_discharge(c, discharge_commands[c]);
Expand Down

0 comments on commit 4072625

Please sign in to comment.