perf: Monitor battery and read /capacity by default

This commit is contained in:
robshape 2023-04-20 11:43:39 +02:00
parent 131b49e948
commit 8d73b8de93
2 changed files with 9 additions and 4 deletions

View file

@ -39,7 +39,7 @@ cd $(dirname "$0")
####################################### #######################################
keymon.elf & # &> $LOGS_PATH/keymon.txt & keymon.elf & # &> $LOGS_PATH/keymon.txt &
# ./batmon.sh &> /mnt/sdcard/batmon.txt & ./batmon.sh &> /mnt/sdcard/batmon.txt &
####################################### #######################################
@ -50,7 +50,7 @@ while [ -f "$EXEC_PATH" ]; do
overclock.elf $CPU_SPEED_PERF overclock.elf $CPU_SPEED_PERF
./minui.elf &> $LOGS_PATH/minui.txt ./minui.elf &> $LOGS_PATH/minui.txt
sync sync
if [ -f $NEXT_PATH ]; then if [ -f $NEXT_PATH ]; then
CMD=`cat $NEXT_PATH` CMD=`cat $NEXT_PATH`
eval $CMD eval $CMD

View file

@ -1392,8 +1392,13 @@ static void POW_updateBatteryStatus(void) {
pow.is_charging = getInt("/sys/class/power_supply/battery/charger_online"); pow.is_charging = getInt("/sys/class/power_supply/battery/charger_online");
// TODO: newer batteries have a different range, ???-??? // TODO: newer batteries have a different range, ???-???
int i = getInt("/sys/class/power_supply/battery/voltage_now") / 10000; // 310-410 // int i = getInt("/sys/class/power_supply/battery/voltage_now") / 10000; // 310-410
i -= 310; // ~0-100 // i -= 310; // ~0-100
// Battery ramp is wrong for bigger batteries. Need to log drain for 2600 mAh, 3500 mAh, and
// update range. Reading /capacity seems more accurate for 2600 mAh.
int i = getInt("/sys/class/power_supply/battery/capacity");
// worry less about battery and more about the game you're playing // worry less about battery and more about the game you're playing
if (i>80) pow.charge = 100; if (i>80) pow.charge = 100;