mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 21:56:31 +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
|
#!/bin/bash
|
||||||
|
|
||||||
gpio=35
|
|
||||||
check_interval=30
|
check_interval=30
|
||||||
export=/sys/class/gpio/export
|
readv=/sys/class/leds/led1/brightness
|
||||||
readv=/sys/class/gpio/gpio$gpio/value
|
|
||||||
|
test -e "$readv" || exit 0
|
||||||
|
|
||||||
test -n "$os_version" || source /etc/init.d/base
|
test -n "$os_version" || source /etc/init.d/base
|
||||||
|
|
||||||
configure() {
|
|
||||||
echo $gpio > $export
|
|
||||||
}
|
|
||||||
|
|
||||||
watch() {
|
watch() {
|
||||||
while true; do
|
while true; do
|
||||||
if [ "$(cat $readv)" == "0" ]; then
|
if [ "$(cat $readv)" == "0" ]; then
|
||||||
@ -23,9 +19,8 @@ watch() {
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
msg_begin "Starting brownout detector"
|
msg_begin "Starting brownout detector"
|
||||||
configure
|
|
||||||
test $? == 0 && msg_done || msg_fail
|
|
||||||
watch &
|
watch &
|
||||||
|
test $? == 0 && msg_done || msg_fail
|
||||||
;;
|
;;
|
||||||
|
|
||||||
stop)
|
stop)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user