From 5c73a4b88398eb181d3f44df7ac3a6b509ad9396 Mon Sep 17 00:00:00 2001 From: Lene Marquardt Date: Wed, 28 May 2025 22:19:05 +0200 Subject: [PATCH] 6 bms + check ams_in for plausibility --- AMS_Master_Code/Core/Inc/config_ADBMS6830.h | 2 +- AMS_Master_Code/Core/Src/can.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AMS_Master_Code/Core/Inc/config_ADBMS6830.h b/AMS_Master_Code/Core/Inc/config_ADBMS6830.h index be865e4..7a4cf85 100644 --- a/AMS_Master_Code/Core/Inc/config_ADBMS6830.h +++ b/AMS_Master_Code/Core/Inc/config_ADBMS6830.h @@ -2,7 +2,7 @@ #ifndef __CONFIG_ADBMS6830_H #define __CONFIG_ADBMS6830_H -#define N_BMS 1 +#define N_BMS 6 #define N_CELLS 16 #define ADBMS_MAX_CHIP_TEMP 1100 // max temperature of ADBMS6830B (not battery) in C #define ADBMS_SPI_TIMEOUT 50 // Timeout in ms diff --git a/AMS_Master_Code/Core/Src/can.c b/AMS_Master_Code/Core/Src/can.c index e2b2d33..f3dd71e 100644 --- a/AMS_Master_Code/Core/Src/can.c +++ b/AMS_Master_Code/Core/Src/can.c @@ -167,7 +167,9 @@ void ftcan_msg_received_cb(uint16_t id, size_t len, const uint8_t *data) { } break; case CAN_ID_AMS_IN: - ts_sm_handle_ams_in(data); + if(len == 1){ //check bc inverter sends 4 byte message to 0xB which causes discharge (prob) + ts_sm_handle_ams_in(data); + } break; default: break;