Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler bug, MSP2_INAV_ANALOG and convert amperage from int32_t to int16_t #3469

Merged
merged 2 commits into from Jun 28, 2018

Conversation

Projects
None yet
3 participants
@shellixyz
Copy link
Collaborator

commented Jun 27, 2018

  • Work around compiler bug in int64 math causing issues with mAh and mWh calculations when amperage is negative
  • Fix MSP2_INAV_ANALOG to return possible negative values of power, mAhDrawn and mWhDrawn
  • int16_t should be enough for amperage (+-325A)

Matching configurator update: iNavFlight/inav-configurator#500

shellixyz added some commits Jun 27, 2018

Fix MSP2_INAV_ANALOG and convert amperage from int32_t to int16_t
- Fix MSP2_INAV_ANALOG to return possible negative values of `power`, `mAhDrawn` and `mWhDrawn`
- int16_t should be enough for amperage (+-325A)

@shellixyz shellixyz changed the title Fix MSP2_INAV_ANALOG and convert amperage from int32_t to int16_t Fix compiler bug, MSP2_INAV_ANALOG and convert amperage from int32_t to int16_t Jun 28, 2018

@giacomo892

This comment has been minimized.

Copy link
Collaborator

commented Jun 28, 2018

Tried on the bench and last commit fixed my issues with crazy mah readings on the OSD

@fiam fiam merged commit a8415e8 into iNavFlight:development Jun 28, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@fiam fiam added this to the 2.0 milestone Jun 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.