diff --git a/Core/Src/slave_monitoring.c b/Core/Src/slave_monitoring.c index e3811eb..a6d568a 100644 --- a/Core/Src/slave_monitoring.c +++ b/Core/Src/slave_monitoring.c @@ -91,9 +91,10 @@ void slaves_check() { } 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 error_kind = ftcan_unmarshal_unsigned(&data, 1); + uint8_t error_kind = ftcan_unmarshal_unsigned(ptr, 1); switch (error_kind) { case SLAVE_PANIC_OT: slaves[idx].error.kind = SLAVE_ERR_OT;