add new internal bms fault slave error code
This commit is contained in:
parent
8005b94b24
commit
f9fafd931c
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue