Skip to content

Commit

Permalink
Fix HW5 missing call to updateConsumption (rotorflight#119)
Browse files Browse the repository at this point in the history
Co-authored-by: Rotorflight <[email protected]>
  • Loading branch information
bob01 and rotorflight committed Jun 14, 2024
1 parent 973696f commit 26567d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/sensors/esc_sensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,14 @@ static bool pl5Decode(timeUs_t currentTimeUs)
}
}

static bool pl5Crank(timeUs_t currentTimeUs)
{
// Update consumption on each cycle vs each frame in decode
updateConsumption(currentTimeUs);

return true;
}

static int8_t pl5Accept(uint16_t c)
{
if (readBytes == 1) {
Expand Down Expand Up @@ -1797,6 +1805,7 @@ static serialReceiveCallbackPtr pl5SensorInit(bool bidirectional)
rrfsmMinFrameLength = PL5_MIN_FRAME_LENGTH;
rrfsmAccept = pl5Accept;
rrfsmDecode = pl5Decode;
rrfsmCrank = pl5Crank;

paramSig = PL5_PARAM_SIG;

Expand Down

0 comments on commit 26567d3

Please sign in to comment.