mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 13:46:32 +00:00
raspberrypi: brownout detector uses now the /sys/class/leds interface
This commit is contained in:
parent
2c387df2ea
commit
e75bd408d9
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user