master
bryan 2021-01-02 04:15:10 +00:00
parent d6ec9ee7e9
commit a2c9d41c71
1 changed files with 5 additions and 1 deletions

View File

@ -39,7 +39,11 @@ function shutdownCommand() {
# @return ... 0,1 as return value # @return ... 0,1 as return value
function isBatteryAvailable() { function isBatteryAvailable() {
local flags=$(i2cget -f -y 0 0x34 0x01) local flags=$(i2cget -f -y 0 0x34 0x01)
return $(((( $flags&0x20 ) >>5 ) == $TRUE )) if (((( $flags&0x20 ) >>5 ) == $TRUE )); then
echo "1"
else
echo "0"
fi
} }
# @return ... voltage as string # @return ... voltage as string