Skip to content

Commit

Permalink
Fix for high voltage value
Browse files Browse the repository at this point in the history
  • Loading branch information
dalathegreat committed Jan 31, 2024
1 parent 01a17b8 commit 0bb5513
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Software/src/battery/TESLA-MODEL-3-BATTERY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 0bb5513

Please sign in to comment.