We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2397 - SDL_GetPowerInfo returns implausible batter percentage value on iOS
Summary: SDL_GetPowerInfo returns implausible batter percentage value on iOS
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: main (show other bugs)
Version: HG 2.1
Hardware: iPhone/iPod touch iOS 6
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-13 22:10 UTC by Felix Hädicke
Modified: 2014-02-17 16:48 UTC (History)
1 user (show)

See Also:


Attachments
Bugfix: Corrected formula for calculating battery percentage with UIKit (577 bytes, patch)
2014-02-13 22:10 UTC, Felix Hädicke
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Hädicke 2014-02-13 22:10:51 UTC
Created attachment 1558 [details]
Bugfix: Corrected formula for calculating battery percentage with UIKit

SDL_GetPowerInfo returns always a value >= 50 %, most of the time 100 %, as percentage of battery life left

This is caused by an incorrect formula for calculating the percentage value. The attached patch should fix it.
Comment 1 Ryan C. Gordon 2014-02-17 16:48:27 UTC
This patch is now https://hg.libsdl.org/SDL/rev/01a7b69c4fb7 ...thanks!

--ryan.