diff options
author | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-04-03 10:01:07 +0000 |
---|---|---|
committer | blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2013-04-03 10:01:07 +0000 |
commit | f604e056e9c4f74d4e3ab17df0cc45f1e0f5a743 (patch) | |
tree | 60a8c2de8bcda43c84dd4db30073857373414db4 /target/linux | |
parent | f224ffda7451772a32e4b2eaded288667b399ef1 (diff) |
[lantiq] Migrate lantiq platform to common led helper functions
http://patchwork.openwrt.org/patch/3316/
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36187 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux')
-rw-r--r-- | target/linux/lantiq/base-files/etc/diag.sh | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh index d0088f5bcc..9e0e1701cb 100644 --- a/target/linux/lantiq/base-files/etc/diag.sh +++ b/target/linux/lantiq/base-files/etc/diag.sh @@ -1,42 +1,24 @@ #!/bin/sh -# Copyright (C) 2012 OpenWrt.org +# Copyright (C) 2012-2013 OpenWrt.org -[ -d /sys/class/leds/power/ ] || return +. /lib/functions/leds.sh -set_state() { - [ -d /sys/class/leds/power1/ ] && { - - case "$1" in - preinit) - echo heartbeat >/sys/class/leds/power/trigger - ;; - failsafe) - echo none >/sys/class/leds/power/trigger - echo timer >/sys/class/leds/power1/trigger - echo 100 >/sys/class/leds/power1/delay_on - echo 100 >/sys/class/leds/power1/delay_off - ;; - done) - echo none >/sys/class/leds/power/trigger - echo none >/sys/class/leds/power1/trigger - echo 1 >/sys/class/leds/power/brightness - ;; - esac - return - } +status_led="power" +set_state() { case "$1" in preinit) - echo heartbeat >/sys/class/leds/power/trigger + status_led_set_heartbeat ;; failsafe) - echo timer >/sys/class/leds/power/trigger - echo 100 >/sys/class/leds/power/delay_on - echo 100 >/sys/class/leds/power/delay_off + [ -d /sys/class/leds/power1 ] && { + status_led_off + led_timer "power1" 100 100 + } || status_led_set_timer 100 100 ;; done) - echo none >/sys/class/leds/power/trigger - echo 1 >/sys/class/leds/power/brightness + status_led_on + led_off "power1" ;; esac } |