Don't return battery level in percentage

This commit is contained in:
Kristian Sloth Lauszus 2013-03-30 16:25:28 +01:00
parent 219bd50c30
commit 7e8564867a
2 changed files with 2 additions and 5 deletions

View file

@ -439,10 +439,7 @@ ControllerStatus Breakdown
ControllerStatus[controller] & 0x8000 // 0
*/
uint8_t XBOXRECV::getBatteryLevel(uint8_t controller) {
uint8_t batteryLevel = ((controllerStatus[controller] & 0x00C0) >> 6) * 33;
if (batteryLevel == 99)
batteryLevel = 100;
return batteryLevel;
return ((controllerStatus[controller] & 0x00C0) >> 6);
}
void XBOXRECV::XboxCommand(uint8_t controller, uint8_t* data, uint16_t nbytes) {

View file

@ -191,7 +191,7 @@ public:
/**
* Used to get the battery level from the controller.
* @param controller The controller to read from.
* @return Returns the battery level in percentage in 33% steps.
* @return Returns the battery level as an integer in the range of 0-3.
*/
uint8_t getBatteryLevel(uint8_t controller);
/**