crc old in use
This commit is contained in:
parent
016afc755f
commit
601f3c33e1
@ -12,6 +12,7 @@
|
|||||||
#include "swo_log.h"
|
#include "swo_log.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
|
#include "ADBMS_CRC_OLD.c"
|
||||||
|
|
||||||
#define INITIAL_COMMAND_PEC 0x0010
|
#define INITIAL_COMMAND_PEC 0x0010
|
||||||
#define INITIAL_DATA_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);
|
return HAL_SPI_TransmitReceive(adbmsspi, txbuffer, rxbuffer, buffersize, ADBMS_SPI_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
//command PEC calculation
|
/* //command PEC calculation
|
||||||
//CRC-15
|
//CRC-15
|
||||||
//x^15 + x^14 + x^10 + x^8 + x^7 + x^4 + x^3 + 1
|
//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; }
|
if (len <= 2) { return 255; }
|
||||||
// Zero remainder means a valid CRC.
|
// Zero remainder means a valid CRC.
|
||||||
return (computeCRC10(data, len, false) == 0) ? 0 : 1;
|
return (computeCRC10(data, len, false) == 0) ? 0 : 1;
|
||||||
}
|
} */
|
||||||
|
|
||||||
static const char* const HAL_Statuses[] = {"HAL_OK", "HAL_ERROR", "HAL_BUSY", "HAL_TIMEOUT"};
|
static const char* const HAL_Statuses[] = {"HAL_OK", "HAL_ERROR", "HAL_BUSY", "HAL_TIMEOUT"};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user