From a979430e9b2b9b11f858d751bcb9b98be760ab3b Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Fri, 16 Nov 2018 14:00:01 +0100 Subject: [PATCH] [ bsp ] adding axp813 way of displaying battery status on Olimex Lime A64 and similar boards --- packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo b/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo index 9cfae92513..22db3bd4f4 100755 --- a/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo +++ b/packages/bsp/common/etc/update-motd.d/30-armbian-sysinfo @@ -75,6 +75,13 @@ function batteryinfo() { status_battery_text=" discharging" fi fi + elif [[ -e "$legacy_dir/axp813-ac" ]]; then + read status_battery_connected < $legacy_dir/axp20x-battery/present + if [[ "$status_battery_connected" == "1" ]]; then + status_battery_text=" "$(awk '{print tolower($0)}' < $legacy_dir/axp20x-battery/status) + read status_ac_connect < $legacy_dir/axp813-ac/present + read battery_percent< $legacy_dir/axp20x-battery/capacity + fi elif [[ -e "$legacy_dir/battery" ]]; then if [[ (("$(cat $legacy_dir/battery/voltage_now)" -gt "5" )) ]]; then status_battery_text=" "$(awk '{print tolower($0)}' < $legacy_dir/battery/status)