From 410597c0f3a162b25dacc838c682f48b8a503455 Mon Sep 17 00:00:00 2001 From: "Jasper v. Blanckenburg" Date: Mon, 3 Jul 2023 14:20:24 +0200 Subject: [PATCH] Correctly unmarshal slave error kinds --- Core/Src/slave_monitoring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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;