Function bal_get_cells_to_discharge(voltage_t, uint16_t, voltage_t, uint16_t)

Function Documentation

uint16_t bal_get_cells_to_discharge(voltage_t volts[], uint16_t count, voltage_t threshold, uint16_t cells[])

Wrapper function around bal_compute_imbalance and bal_exclude_neighbors.

Return
amount of cells to be discharged
Parameters
  • volts: Array of cell voltages
  • count: Size of volts
  • threshold: Balancing tolerance (voltage + threshold)
  • indexes: Output array of indexes to be balanced
  • cells: array of cell’s indexes that need to be discharged