Handle fucked slave EEPROMs
This commit is contained in:
parent
fdd9c3f4af
commit
7c7ae41ee6
@ -12,6 +12,7 @@
|
|||||||
#define CAN_ID_AMS_IN 0x00B
|
#define CAN_ID_AMS_IN 0x00B
|
||||||
#define CAN_ID_AMS_ERROR 0x00C
|
#define CAN_ID_AMS_ERROR 0x00C
|
||||||
#define CAN_ID_SLAVE_STATUS_BASE 0x080
|
#define CAN_ID_SLAVE_STATUS_BASE 0x080
|
||||||
|
#define CAN_ID_SLAVE_STATUS_FUCKED 0x0A0
|
||||||
#define CAN_ID_SLAVE_LOG 0x4F4
|
#define CAN_ID_SLAVE_LOG 0x4F4
|
||||||
#define CAN_ID_SHUNT_BASE 0x520
|
#define CAN_ID_SHUNT_BASE 0x520
|
||||||
#define CAN_ID_SHUNT_CURRENT 0x521
|
#define CAN_ID_SHUNT_CURRENT 0x521
|
||||||
|
@ -18,6 +18,7 @@ void can_init(CAN_HandleTypeDef *handle) {
|
|||||||
ftcan_add_filter(CAN_ID_AMS_IN, 0xFFF);
|
ftcan_add_filter(CAN_ID_AMS_IN, 0xFFF);
|
||||||
ftcan_add_filter(CAN_ID_SLAVE_PANIC, 0xFFF);
|
ftcan_add_filter(CAN_ID_SLAVE_PANIC, 0xFFF);
|
||||||
ftcan_add_filter(CAN_ID_SLAVE_STATUS_BASE, 0xFF0);
|
ftcan_add_filter(CAN_ID_SLAVE_STATUS_BASE, 0xFF0);
|
||||||
|
ftcan_add_filter(CAN_ID_SLAVE_STATUS_FUCKED, 0xFFF);
|
||||||
ftcan_add_filter(CAN_ID_SLAVE_LOG, 0xFFF);
|
ftcan_add_filter(CAN_ID_SLAVE_LOG, 0xFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,6 +51,8 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) {
|
|||||||
} else if ((id & 0xFF0) == CAN_ID_SLAVE_STATUS_BASE) {
|
} else if ((id & 0xFF0) == CAN_ID_SLAVE_STATUS_BASE) {
|
||||||
slaves_handle_status(data);
|
slaves_handle_status(data);
|
||||||
return;
|
return;
|
||||||
|
} else if (id == CAN_ID_SLAVE_STATUS_FUCKED) {
|
||||||
|
slaves_handle_status(data);
|
||||||
}
|
}
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case CAN_ID_SLAVE_PANIC:
|
case CAN_ID_SLAVE_PANIC:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user