mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Add detection for 102s to 70kWh
This commit is contained in:
parent
ef6d823e98
commit
cf71ec9de2
1 changed files with 6 additions and 0 deletions
|
@ -236,6 +236,12 @@ void update_values_battery() { //This function maps all the values fetched via
|
|||
|
||||
datalayer.battery.status.current_dA;
|
||||
|
||||
if (poll_amount_cells == 102) { // We have determined that we are on 70kWh pack
|
||||
datalayer.battery.info.total_capacity_Wh = 70000;
|
||||
datalayer.battery.info.max_design_voltage_dV = MAX_PACK_VOLTAGE_70_DV;
|
||||
datalayer.battery.info.min_design_voltage_dV = MIN_PACK_VOLTAGE_70_DV;
|
||||
}
|
||||
|
||||
//Calculate the remaining Wh amount from SOC% and max Wh value.
|
||||
datalayer.battery.status.remaining_capacity_Wh = static_cast<uint32_t>(
|
||||
(static_cast<double>(datalayer.battery.status.real_soc) / 10000) * datalayer.battery.info.total_capacity_Wh);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue