Skip to content

Commit

Permalink
AP_Periph: fixed current decoding for HWESC
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Mar 4, 2020
1 parent bca1bd2 commit 5462c46
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Tools/AP_Periph/hwing_esc.cpp
Expand Up @@ -105,8 +105,8 @@ bool HWESC_Telem::parse_packet(void)
decoded.throttle = be16toh(pkt.throttle);
decoded.rpm = be16toh(pkt.rpm);
decoded.voltage = be16toh(pkt.voltage) * 0.1;
decoded.load = be16toh(pkt.load);
decoded.current = be16toh(pkt.current);
decoded.load = int16_t(be16toh(pkt.load));
decoded.current = int16_t(be16toh(pkt.current)) * 0.01;
decoded.temperature = be16toh(pkt.temperature);
decoded.unknown = be16toh(pkt.unknown);

Expand Down
4 changes: 2 additions & 2 deletions Tools/AP_Periph/hwing_esc.h
Expand Up @@ -44,8 +44,8 @@ class HWESC_Telem {
uint16_t throttle;
uint16_t rpm;
uint16_t voltage;
uint16_t load;
uint16_t current;
int16_t current;
int16_t load;
uint16_t temperature;
uint16_t unknown;
uint16_t crc;
Expand Down

0 comments on commit 5462c46

Please sign in to comment.