From 601f3c33e180495b524c84c5c0cf38a23a53bfb1 Mon Sep 17 00:00:00 2001 From: kbracher Date: Sat, 22 Mar 2025 16:09:23 +0100 Subject: [PATCH] crc old in use --- .../Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_LL_Driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_LL_Driver.c b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_LL_Driver.c index 0914936..860657b 100644 --- a/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_LL_Driver.c +++ b/AMS_Master_Code/Core/Lib/ADBMS6830B_Driver/Core/Src/ADBMS_LL_Driver.c @@ -12,6 +12,7 @@ #include "swo_log.h" #include #include +#include "ADBMS_CRC_OLD.c" #define INITIAL_COMMAND_PEC 0x0010 #define INITIAL_DATA_PEC 0x0010 @@ -41,7 +42,7 @@ static HAL_StatusTypeDef mcuSPITransmitReceive(uint8_t* rxbuffer, uint8_t* txbuf return HAL_SPI_TransmitReceive(adbmsspi, txbuffer, rxbuffer, buffersize, ADBMS_SPI_TIMEOUT); } -//command PEC calculation +/* //command PEC calculation //CRC-15 //x^15 + x^14 + x^10 + x^8 + x^7 + x^4 + x^3 + 1 @@ -126,7 +127,7 @@ static uint8_t checkDataPEC(uint8_t* data, uint8_t len) { if (len <= 2) { return 255; } // Zero remainder means a valid CRC. return (computeCRC10(data, len, false) == 0) ? 0 : 1; -} +} */ static const char* const HAL_Statuses[] = {"HAL_OK", "HAL_ERROR", "HAL_BUSY", "HAL_TIMEOUT"};