1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

fixed negative currents messing up the mAh counter

now there is no virtually limit for the mAh drawn counter.
The outpout is limited by the mwii serial protocol tough (~65Ah)
This commit is contained in:
luggi 2014-06-01 15:38:17 +02:00
parent 3c0f0f7ed4
commit 40392d06b8
3 changed files with 7 additions and 7 deletions

View file

@ -472,12 +472,12 @@ static void evaluateCommand(void)
case MSP_ANALOG:
headSerialReply(7);
serialize8((uint8_t)constrain(vbat, 0, 255));
serialize16(mAhdrawn); // milliamphours drawn from battery
serialize16((uint16_t)constrain(mAhdrawn, 0, 0xFFFF)); // milliamphours drawn from battery
serialize16(rssi);
if (mcfg.multiwiicurrentoutput)
serialize16((uint16_t)constrain((abs(amperage) * 10), 0, 0xFFFF)); // send amperage in 0.001 A steps
else
serialize16((uint16_t)abs(amperage)); // send amperage in 0.01 A steps
serialize16((uint16_t)constrain(abs(amperage), 0, 0xFFFF)); // send amperage in 0.01 A steps
break;
case MSP_RC_TUNING:
headSerialReply(7);