Skip to content

Commit

Permalink
ESC_APD : Correct current reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradeep-Carbonix committed Nov 27, 2023
1 parent 8252c30 commit 235cbb7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Tools/AP_Periph/esc_apd_telem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ bool ESC_APD_Telem::update() {
// valid packet, copy the data we need and reset length
decoded.voltage = le16toh(received.packet.voltage) * 1e-2f;
decoded.temperature = convert_temperature(le16toh(received.packet.temperature));
decoded.current = le16toh(received.packet.bus_current) * (1 / 12.5f);
int16_t temp_current = le16toh(received.packet.bus_current);
decoded.current = temp_current * (1 / 12.5f);
decoded.rpm = le32toh(received.packet.erpm) / pole_count;
decoded.power_rating_pct = le16toh(received.packet.motor_duty) * 1e-2f;
ret = true;
Expand Down

0 comments on commit 235cbb7

Please sign in to comment.