mirror of
https://github.com/FunKey-Project/FunKey-OS.git
synced 2025-12-14 00:28:53 +01:00
bug correction in low_bat_check
This commit is contained in:
parent
d95fba5154
commit
4dd0ad57d6
@ -1,11 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# General constants declaration
|
# General constants declaration
|
||||||
THRESHOLD_PERCENT_LOW_BAT=5
|
THRESHOLD_PERCENT_LOW_BAT=105
|
||||||
THRESHOLD_PERCENT_EXTREMELY_LOW_BAT=2
|
THRESHOLD_PERCENT_EXTREMELY_LOW_BAT=2
|
||||||
MAX_EXTREMELY_LOW_BAT_BEFORE_SHUTDOWN=5
|
MAX_EXTREMELY_LOW_BAT_BEFORE_SHUTDOWN=5
|
||||||
SLEEP_SECS=2
|
SLEEP_SECS=2
|
||||||
RESCALE_MAX_PERCENTAGE=110
|
RESCALE_MAX_PERCENTAGE=112
|
||||||
|
|
||||||
# Blink Low bat constants declaration
|
# Blink Low bat constants declaration
|
||||||
BLINK_ICON=0
|
BLINK_ICON=0
|
||||||
@ -33,9 +33,9 @@ echo 0 > ${LOW_BAT_ICON}
|
|||||||
|
|
||||||
# Check low bat #
|
# Check low bat #
|
||||||
while true; do
|
while true; do
|
||||||
#echo "Bat present: "$(cat ${BAT_PRESENT_FILE})"
|
#echo "Bat present: $(cat ${BAT_PRESENT_FILE})"
|
||||||
#echo "USB present: "$(cat ${USB_PRESENT_FILE})"
|
#echo "USB present: $(cat ${USB_PRESENT_FILE})"
|
||||||
#echo "Bat percentage: "$(cat ${BAT_PERCENT_FILE})"
|
#echo "Bat percentage: $(cat ${BAT_PERCENT_FILE})"
|
||||||
|
|
||||||
# Get current bat percentage here once
|
# Get current bat percentage here once
|
||||||
cur_bat_percent=$(cat ${BAT_PERCENT_FILE})
|
cur_bat_percent=$(cat ${BAT_PERCENT_FILE})
|
||||||
@ -59,7 +59,7 @@ while true; do
|
|||||||
if [ "${cur_bat_percent}" -ne "0" ]; then
|
if [ "${cur_bat_percent}" -ne "0" ]; then
|
||||||
|
|
||||||
# Check if we must change state
|
# Check if we must change state
|
||||||
if [ {$cur_bat_percent} -le ${THRESHOLD_PERCENT_LOW_BAT} -a ${low_bat_status} -eq 0 ]; then
|
if [ ${cur_bat_percent} -le ${THRESHOLD_PERCENT_LOW_BAT} -a ${low_bat_status} -eq 0 ]; then
|
||||||
|
|
||||||
# Set Low Bat status
|
# Set Low Bat status
|
||||||
low_bat_status=1
|
low_bat_status=1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user