See desc for more.

1.) Fix Themes touch position.

2.) Properly detect if battery is full charged using `PTMU_GetAdapterState()` and `PTMU_GetBatteryChargeState()` together.
This commit is contained in:
StackZ
2021-03-15 16:06:10 +01:00
parent 9eefef85d4
commit eaf82d8849
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -165,11 +165,14 @@ static int blinkDelay = 40;
static bool blinkState = true, batteryLow = false;
void GFX::DrawBattery() {
u8 chargeState = false, level = 0;
bool chargerPlugged = false;
PTMU_GetBatteryChargeState(&chargeState); // Get Charge state.
PTMU_GetBatteryLevel(&level); // Get Battery Level.
PTMU_GetAdapterState(&chargerPlugged); // Get if charger adapter is plugged.
if (chargeState) {
GFX::DrawSprite((level < 5 ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1);
if (chargerPlugged) {
GFX::DrawSprite((chargeState ? sprites_battery_charge_idx : sprites_battery_charge_full_idx), 366, 1);
if (batteryLow) batteryLow = false; // Cause we're charging.
} else {
+1 -1
View File
@@ -78,7 +78,7 @@ static const std::vector<Structs::ButtonPos> dirIcons = {
};
static const Structs::ButtonPos back = { 45, 0, 24, 24 }; // Back arrow for directory.
static const Structs::ButtonPos Themes = { 40, 220, 280, 24 }; // Themes.
static const Structs::ButtonPos Themes = { 40, 196, 280, 24 }; // Themes.
static const std::vector<std::string> mainStrings = { "LANGUAGE", "SELECT_UNISTORE", "AUTO_UPDATE_SETTINGS_BTN", "GUI_SETTINGS_BTN", "DIRECTORY_SETTINGS_BTN", "CREDITS", "EXIT_APP" };