Skip to content

Commit

Permalink
fix: extra warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ABeltramo committed Mar 28, 2024
1 parent 9476b6d commit 20dad44
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/platform/linux/inputtino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ namespace platf {
}
// Only the PS5 controller supports motion
if (std::holds_alternative<inputtino::PS5Joypad>(*gamepad->joypad)) {
inputtino::PS5Joypad::BATTERY_STATE state;
inputtino::PS5Joypad::BATTERY_STATE state = inputtino::PS5Joypad::CHARGHING_ERROR;
switch (battery.state) {
case LI_BATTERY_STATE_CHARGING:
state = inputtino::PS5Joypad::BATTERY_CHARGHING;
Expand All @@ -614,12 +614,6 @@ namespace platf {
case LI_BATTERY_STATE_FULL:
state = inputtino::PS5Joypad::BATTERY_FULL;
break;
case LI_BATTERY_STATE_NOT_CHARGING:
case LI_BATTERY_PERCENTAGE_UNKNOWN:
case LI_BATTERY_STATE_UNKNOWN:
case LI_BATTERY_STATE_NOT_PRESENT:
state = inputtino::PS5Joypad::CHARGHING_ERROR;
break;
}
std::get<inputtino::PS5Joypad>(*gamepad->joypad).set_battery(state, battery.percentage / 2.55); // TODO: 255 (0xFF) is 100%?
}
Expand Down

0 comments on commit 20dad44

Please sign in to comment.