Browse Source

fix battery capacity reset in reformd; timestamp to unixtime; make suspend command more universal

master
mntmn 10 months ago
parent
commit
cf141212f3
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      reformd/reformd.sh

+ 4
- 4
reformd/reformd.sh View File

@@ -57,7 +57,7 @@ function reset_bat_capacity {
setup_serial
exec 99<>/dev/ttymxc1
:<&99
printf "0600b\r" >&99
printf "0600c\r" >&99
exec 99>&-
}

@@ -71,7 +71,7 @@ function system_suspend {
set +e; timeout 1 head /dev/ttymxc1; set -e

# zzZzzZ
# systemctl suspend
echo -n mem > /sys/power/state
}

function regulate_fan {
@@ -102,12 +102,12 @@ function main {
# so it can be graphed and we can estimate remaining running time
# TODO actually append to log and rotate it out
# TODO interval?
timestamp=$(date +%Y-%m-%dT%H:%M:%S)
timestamp=$(date +%s)
get_soc_temperature
get_battery_state
get_lid_state

if [ "$bat_amps" == "0.00A" ]
if [ "$bat_amps" == "0.00" ]
then
reset_bat_capacity
fi

Loading…
Cancel
Save