all repos — mgba @ bb6ecd41cb8446d1df43b6d7a0cb4638091a5c7b

mGBA Game Boy Advance Emulator

Switch: Show charging info
Vicki Pfau vi@endrift.com
Tue, 18 Sep 2018 20:51:52 -0700
commit

bb6ecd41cb8446d1df43b6d7a0cb4638091a5c7b

parent

4b012035d83026cb86e9126dcafee9a02c9f2cd9

1 files changed, 4 insertions(+), 0 deletions(-)

jump to
M src/platform/switch/main.csrc/platform/switch/main.c

@@ -312,6 +312,10 @@ int state = 0;

if (R_SUCCEEDED(psmGetBatteryChargePercentage(&charge))) { state = charge / 25; } + ChargerType type; + if (R_SUCCEEDED(psmGetChargerType(&type)) && type) { + state |= BATTERY_CHARGING; + } return state; }