Correctly unmarshal slave error kinds
This commit is contained in:
parent
12422071a5
commit
410597c0f3
|
@ -91,9 +91,10 @@ void slaves_check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void slaves_handle_panic(const uint8_t *data) {
|
void slaves_handle_panic(const uint8_t *data) {
|
||||||
uint8_t slave_id = ftcan_unmarshal_unsigned(&data, 1);
|
const uint8_t **ptr = &data;
|
||||||
|
uint8_t slave_id = ftcan_unmarshal_unsigned(ptr, 1);
|
||||||
uint8_t idx = get_slave_index(slave_id);
|
uint8_t idx = get_slave_index(slave_id);
|
||||||
uint8_t error_kind = ftcan_unmarshal_unsigned(&data, 1);
|
uint8_t error_kind = ftcan_unmarshal_unsigned(ptr, 1);
|
||||||
switch (error_kind) {
|
switch (error_kind) {
|
||||||
case SLAVE_PANIC_OT:
|
case SLAVE_PANIC_OT:
|
||||||
slaves[idx].error.kind = SLAVE_ERR_OT;
|
slaves[idx].error.kind = SLAVE_ERR_OT;
|
||||||
|
|
Loading…
Reference in New Issue