Browse Source

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

mntmn 4 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 {
57 57
     setup_serial
58 58
     exec 99<>/dev/ttymxc1
59 59
     :<&99
60
-    printf "0600b\r" >&99
60
+    printf "0600c\r" >&99
61 61
     exec 99>&-
62 62
 }
63 63
 
@@ -71,7 +71,7 @@ function system_suspend {
71 71
     set +e; timeout 1 head /dev/ttymxc1; set -e
72 72
 
73 73
     # zzZzzZ
74
-    # systemctl suspend
74
+    echo -n mem > /sys/power/state
75 75
 }
76 76
 
77 77
 function regulate_fan {
@@ -102,12 +102,12 @@ function main {
102 102
     # so it can be graphed and we can estimate remaining running time
103 103
     # TODO actually append to log and rotate it out
104 104
     # TODO interval?
105
-    timestamp=$(date +%Y-%m-%dT%H:%M:%S)
105
+    timestamp=$(date +%s)
106 106
     get_soc_temperature
107 107
     get_battery_state
108 108
     get_lid_state
109 109
 
110
-    if [ "$bat_amps" == "0.00A" ]
110
+    if [ "$bat_amps" == "0.00" ]
111 111
     then
112 112
         reset_bat_capacity
113 113
     fi

Loading…
Cancel
Save