From e75bd408d9bb092dee1f071283d3d4f8b8f46a57 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 5 Jun 2016 11:34:56 +0300 Subject: [PATCH] raspberrypi: brownout detector uses now the /sys/class/leds interface --- board/raspberrypi/overlay/etc/init.d/S11brownout | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/board/raspberrypi/overlay/etc/init.d/S11brownout b/board/raspberrypi/overlay/etc/init.d/S11brownout index 798f1a15b4..80a256d157 100755 --- a/board/raspberrypi/overlay/etc/init.d/S11brownout +++ b/board/raspberrypi/overlay/etc/init.d/S11brownout @@ -1,16 +1,12 @@ #!/bin/bash -gpio=35 check_interval=30 -export=/sys/class/gpio/export -readv=/sys/class/gpio/gpio$gpio/value +readv=/sys/class/leds/led1/brightness + +test -e "$readv" || exit 0 test -n "$os_version" || source /etc/init.d/base -configure() { - echo $gpio > $export -} - watch() { while true; do if [ "$(cat $readv)" == "0" ]; then @@ -23,9 +19,8 @@ watch() { case "$1" in start) msg_begin "Starting brownout detector" - configure - test $? == 0 && msg_done || msg_fail watch & + test $? == 0 && msg_done || msg_fail ;; stop)