From 0bb5513a502af6a402fe62b3f43f7a84ab4f434c Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 31 Jan 2024 22:36:37 +0200 Subject: [PATCH] Fix for high voltage value --- Software/src/battery/TESLA-MODEL-3-BATTERY.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp index 35d54535..935d7df4 100644 --- a/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp +++ b/Software/src/battery/TESLA-MODEL-3-BATTERY.cpp @@ -456,7 +456,7 @@ void receive_can_tesla_model_3_battery(CAN_frame_t rx_frame) { break; case 0x2b4: low_voltage = (((rx_frame.data.u8[1] & 0x03) << 8) | rx_frame.data.u8[0]) * 0.0390625; - high_voltage = (((rx_frame.data.u8[2] << 6) | ((rx_frame.data.u8[1] & 0xFC) >> 2))) * 0.146484; + high_voltage = ((((rx_frame.data.u8[2] & 0x3F) << 6) | ((rx_frame.data.u8[1] & 0xFC) >> 2))) * 0.146484; output_current = (((rx_frame.data.u8[4] & 0x0F) << 8) | rx_frame.data.u8[3]) / 100; break; case 0x292: