add new internal bms fault slave error code

This commit is contained in:
Kilian Bracher 2024-04-18 01:28:58 +02:00
parent 8005b94b24
commit f9fafd931c
Signed by: k.bracher
SSH Key Fingerprint: SHA256:mXpyZkK7RDiJ7qeHCKJX108woM0cl5TrCvNBJASu6lM
2 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@
#define SLAVE_PANIC_INTERNAL_BMS_TIMEOUT 7
#define SLAVE_PANIC_INTERNAL_BMS_CHECKSUM 8
#define SLAVE_PANIC_INTERNAL_BMS_OVERTEMP 9
#define SLAVE_PANIC_INTERNAL_BMS_FAULT 10
typedef enum {
SLAVE_ERR_NONE,
@ -33,6 +34,7 @@ typedef enum {
SLAVE_ERR_INTERNAL_BMS_TIMEOUT,
SLAVE_ERR_INTERNAL_BMS_CHECKSUM,
SLAVE_ERR_INTERNAL_BMS_OVERTEMP,
SLAVE_ERR_INTERNAL_BMS_FAULT,
SLAVE_ERR_UNKNOWN,
} SlaveErrorKind;

View File

@ -100,7 +100,7 @@ void slaves_handle_panic(const uint8_t *data) {
uint8_t idx = get_slave_index(slave_id);
uint8_t error_kind = ftcan_unmarshal_unsigned(ptr, 1);
switch (error_kind) {
case SLAVE_PANIC_OT ... SLAVE_PANIC_INTERNAL_BMS_OVERTEMP:
case SLAVE_PANIC_OT ... SLAVE_PANIC_INTERNAL_BMS_FAULT:
slaves[idx].error.kind = error_kind + 2; //SlaveErrorKind on master is 2 higher than on slave (errors.h in slave firmware)
break;
default: