fix: make adbms overtemp threshold configurable
This commit is contained in:
parent
8a82ad4cee
commit
ae54db62e0
@ -4,7 +4,7 @@
|
||||
#include "main.h"
|
||||
|
||||
#define N_BMS 1
|
||||
#define ADBMS_SPI_TIMEOUT 100 // Timeout in ms
|
||||
#define ADBMS_MAX_CHIP_TEMP 110 // max temperature of ADBMS6830B (not battery) in C
|
||||
|
||||
[[maybe_unused]] static inline void mcuAdbmsCSLow() {
|
||||
HAL_GPIO_WritePin(AMS_CS_GPIO_Port, AMS_CS_Pin, GPIO_PIN_RESET);
|
||||
|
@ -81,7 +81,7 @@ typedef struct {
|
||||
int16_t auxVoltages[MAXIMUM_AUX_VOLTAGES];
|
||||
|
||||
struct ADBMS6830_Internal_Status status;
|
||||
uint16_t internalDieTemp;
|
||||
int16_t internalDieTemp;
|
||||
uint16_t analogSupplyVoltage;
|
||||
uint16_t digitalSupplyVoltage;
|
||||
uint16_t sumOfCellMeasurements;
|
||||
|
@ -106,8 +106,7 @@ ADBMS_DetailedStatus AMS_Idle_Loop() {
|
||||
return (ADBMS_DetailedStatus){ADBMS_UNDERVOLT, match - 1};
|
||||
}
|
||||
|
||||
// TODO: replace with the correct threshold for the internal die temperature
|
||||
if ((match = any(module.internalDieTemp > 28000 || module.status.THSD))) {
|
||||
if ((match = any(module.internalDieTemp > ADBMS_MAX_CHIP_TEMP || module.status.THSD))) {
|
||||
return (ADBMS_DetailedStatus){ADBMS_INTERNAL_BMS_OVERTEMP, match - 1};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user