From f09566ce4968735b226111cf3ad9707730d01605 Mon Sep 17 00:00:00 2001 From: Moritz Ruffer Date: Wed, 26 Mar 2025 23:12:52 +0100 Subject: [PATCH] added bms id to view --- .../Core/Lib/ADBMS6830B_Driver/Core/Inc/ADBMS_Driver.h | 1 + .../Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_Abstraction.c | 1 + 2 files changed, 2 insertions(+) diff --git a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Inc/ADBMS_Driver.h b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Inc/ADBMS_Driver.h index 2419260..6c8a037 100644 --- a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Inc/ADBMS_Driver.h +++ b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Inc/ADBMS_Driver.h @@ -80,6 +80,7 @@ typedef struct { int16_t cellVoltages[MAXIMUM_CELL_VOLTAGES]; int16_t auxVoltages[MAXIMUM_AUX_VOLTAGES]; uint16_t cellTemps[MAXIMUM_AUX_VOLTAGES]; + uint32_t bmsID; struct ADBMS6830_Internal_Status status; uint16_t internalDieTemp; diff --git a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_Abstraction.c b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_Abstraction.c index e1d6e99..93f794c 100644 --- a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_Abstraction.c +++ b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_Abstraction.c @@ -62,6 +62,7 @@ HAL_StatusTypeDef amsReset() { for (size_t j = 0; j < SID_GROUP_SIZE; j++) { id |= sidbuffer[BUFFER_BMS_OFFSET(i, SID_GROUP_SIZE) + j] << (j * 8); } + modules[i].bmsID = id; debug_log_cont(LOG_LEVEL_INFO, "0x%lx%lx ", (uint32_t)(id >> 32), (uint32_t)(id & 0xFFFFFFFF)); //newlib does not support %llu } }