Zubax / sapog

Sapog - advanced multiplatform ESC firmware
https://kb.zubax.com/x/cYAh
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Off-by-one error in the sensor self-test function #46

Closed suzonch closed 2 years ago

suzonch commented 2 years ago

Here, the correct condition is sample.input_current >= 0:

https://github.com/Zubax/sapog/blob/177ad8339c0486b66dc5c08632c09a61080ce9f1/firmware/src/motor/realtime/motor_rtctl_test.c#L101

This bug did not reveal itself in old hardware due to narrower dynamic range of the current measurement circuit.