Skip to content

Commit

Permalink
Merge pull request #149 from dalathegreat/bugfix/tesla-voltage-high
Browse files Browse the repository at this point in the history
Tesla: Fix for high voltage value
  • Loading branch information
dalathegreat authored Feb 2, 2024
2 parents fa9c912 + 0bb5513 commit 3c23bf5
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 3c23bf5

Please sign in to comment.