reform

MNT Reform: Open Source Portable Computer
Log (Feed) | Files | Refs (Tags) | README

commit cf141212f32b0566c16975ca21206e6d1aabaa2e
parent 8dd5992ae4cbc84f428585c9899a5b6e145c60f1
Author: mntmn <lukas@mnt.mn>
Date:   Thu, 15 Nov 2018 19:15:09 +0100

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

Diffstat:
Mreformd/reformd.sh | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/reformd/reformd.sh b/reformd/reformd.sh @@ -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