Compare commits
No commits in common. "48a06b87ae55df9c1d2a6a65612a37f491ad9815" and "11a2121fd80be4072919d5693842880f45739dc1" have entirely different histories.
48a06b87ae
...
11a2121fd8
1
AMS_Master_Code/.vscode/launch.json
vendored
1
AMS_Master_Code/.vscode/launch.json
vendored
@ -36,6 +36,7 @@
|
||||
"request": "attach",
|
||||
"type": "cortex-debug",
|
||||
"servertype": "openocd",
|
||||
"preLaunchTask": "Build STM",
|
||||
"device": "stm32h7a3xxq.s",
|
||||
"configFiles": [
|
||||
"openocd.cfg"
|
||||
|
@ -104,7 +104,7 @@ static inline void debug_clear_console() {
|
||||
}
|
||||
|
||||
[[gnu::format(printf, 2, 3)]]
|
||||
static inline void debug_log(enum log_level_t level, const char *msg, ...) {
|
||||
static inline void debug_log(unsigned int level, const char *msg, ...) {
|
||||
if (!DEBUG_CHANNEL_ENABLED(level)) {
|
||||
return;
|
||||
}
|
||||
@ -139,7 +139,7 @@ static inline void debug_log(enum log_level_t level, const char *msg, ...) {
|
||||
}
|
||||
|
||||
[[gnu::format(printf, 2, 3)]]
|
||||
static inline void debug_log_cont(enum log_level_t level, const char *msg, ...) {
|
||||
static inline void debug_log_cont(unsigned int level, const char *msg, ...) {
|
||||
if (!DEBUG_CHANNEL_ENABLED(level)) {
|
||||
return;
|
||||
}
|
||||
|
@ -248,10 +248,6 @@ HAL_StatusTypeDef ___readCMD(uint16_t command, uint8_t * buffer, size_t arglen)
|
||||
}
|
||||
}
|
||||
|
||||
if (arglen == 0) {
|
||||
return HAL_OK; //no data to check
|
||||
}
|
||||
|
||||
//check data PEC
|
||||
for (size_t i = 0; i < N_BMS; i++) {
|
||||
size_t offset = BUFFER_BMS_OFFSET(i, arglen);
|
||||
@ -261,14 +257,13 @@ HAL_StatusTypeDef ___readCMD(uint16_t command, uint8_t * buffer, size_t arglen)
|
||||
for (size_t j = 0; j < arglen + 2; j++) {
|
||||
debug_log_cont(LOG_LEVEL_ERROR, "%02X ", buffer[offset + j]);
|
||||
}
|
||||
debug_log_cont(LOG_LEVEL_ERROR, "| %02X %02X ", buffer[offset + arglen], buffer[offset + arglen + 1]); //print out the DPEC
|
||||
debug_log(LOG_LEVEL_ERROR, " DATA ^");
|
||||
debug_log_cont(LOG_LEVEL_ERROR, " | %02X %02X ", buffer[offset + arglen], buffer[offset + arglen + 1]); //print out the DPEC
|
||||
debug_log(LOG_LEVEL_ERROR, "^ DATA");
|
||||
//print out spaces until start of DPEC
|
||||
for (size_t j = 0; j < arglen - 1; j++) {
|
||||
debug_log_cont(LOG_LEVEL_ERROR, (arglen < 2) ? "" : "^^^");
|
||||
for (size_t j = 0; j < arglen; j++) {
|
||||
debug_log_cont(LOG_LEVEL_ERROR, (arglen < 2) ? "" : " ");
|
||||
}
|
||||
debug_log_cont(LOG_LEVEL_ERROR, "^^ ");
|
||||
debug_log_cont(LOG_LEVEL_ERROR, " PEC ^");
|
||||
debug_log(LOG_LEVEL_ERROR, " ^ DPEC");
|
||||
return HAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user