From 61729b302cfb55b29a9b89f6dd2ac0332fb32aa3 Mon Sep 17 00:00:00 2001 From: "Jasper v. Blanckenburg" Date: Mon, 24 Jul 2023 18:21:12 +0200 Subject: [PATCH] Fix BPF unmarshalling --- Core/Src/vehicle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Src/vehicle.c b/Core/Src/vehicle.c index 6d15404..b2f53f3 100644 --- a/Core/Src/vehicle.c +++ b/Core/Src/vehicle.c @@ -100,7 +100,7 @@ void ftcan_msg_received_cb(uint16_t id, size_t datalen, const uint8_t *data) { vehicle_state.last_ams_error.arg = data[1]; break; case CAN_ID_ABX_DRIVER: - vehicle_state.brake_press_f = (data[1] | ((data[2] & 0x0F) << 4)) * 0.1; + vehicle_state.brake_press_f = (data[1] | ((data[2] & 0x0F) << 8)) * 0.1; vehicle_state.brake_press_r = ((data[2] >> 4) | (data[3] << 4)) * 0.1; vehicle_state.speed = data[5] * CAN_ABX_DRIVER_SPEED_FACTOR; break;