🐛 daly: fix includes and temperature power slope

This commit is contained in:
Jakob Löw 2025-03-09 21:31:42 +01:00
parent 3ca3b2e0cb
commit 3366e946ae
No known key found for this signature in database
GPG key ID: B77685F55C7C46C6

View file

@ -1,11 +1,9 @@
#include "DALY-BMS.h" #include "../include.h"
#ifdef DALY_BMS #ifdef DALY_BMS
#include <cstdint> #include <cstdint>
#include "../datalayer/datalayer.h" #include "../datalayer/datalayer.h"
#include "../devboard/utils/events.h" #include "../devboard/utils/events.h"
#include "../include.h" #include "DALY-BMS.h"
#include "RENAULT-TWIZY.h"
#include "RJXZS-BMS.h"
/* Do not change code below unless you are sure what you are doing */ /* Do not change code below unless you are sure what you are doing */
@ -42,7 +40,7 @@ void update_values_battery() {
if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W) if (SOC < 2000 && adaptive_power_limit < datalayer.battery.status.max_discharge_power_W)
datalayer.battery.status.max_discharge_power_W = adaptive_power_limit; datalayer.battery.status.max_discharge_power_W = adaptive_power_limit;
int32_t temperature_limit = (POWER_PER_DEGREE_C * (int32_t)temperature_min_dC + POWER_AT_0_DEGREE_C) / 10; int32_t temperature_limit = POWER_PER_DEGREE_C * (int32_t)temperature_min_dC / 10 + POWER_AT_0_DEGREE_C;
if (temperature_limit <= 0 || temperature_min_dC < BATTERY_MINTEMPERATURE || if (temperature_limit <= 0 || temperature_min_dC < BATTERY_MINTEMPERATURE ||
temperature_max_dC > BATTERY_MAXTEMPERATURE) temperature_max_dC > BATTERY_MAXTEMPERATURE)
temperature_limit = 0; temperature_limit = 0;