diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-11-25 17:20:49 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-11-25 17:20:49 +0000 |
commit | 2a55c53a473e1378a795e84bae2c495a7e5ba982 (patch) | |
tree | e6ac48ceb9dea605cb7f561ceb00c8dd371294eb /package/base-files/files/etc/init.d | |
parent | 58e4dc71b4b125b26fa0e29ee130784f144308ba (diff) | |
download | upstream-2a55c53a473e1378a795e84bae2c495a7e5ba982.tar.gz upstream-2a55c53a473e1378a795e84bae2c495a7e5ba982.tar.bz2 upstream-2a55c53a473e1378a795e84bae2c495a7e5ba982.zip |
base-files: add support for the morse LED trigger
Write "delay" and "message" options to their respective files,
allowing Morse code message configuration through UCI.
The delay (dit length) defaults to 150ms (about 8 words per minute,
suitable for beginners).
Signed-off-by: Petr Viktorin <encukou@gmail.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34380 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files/etc/init.d')
-rwxr-xr-x | package/base-files/files/etc/init.d/led | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index f3f3c3f8a7..729796bcc7 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -24,6 +24,8 @@ load_led() { config_get delayoff $1 delayoff config_get interval $1 interval "50" config_get port_state $1 port_state + config_get delay $1 delay "150" + config_get message $1 message "" if [ "$trigger" = "rssi" ]; then # handled by rssileds userspace process @@ -66,6 +68,11 @@ load_led() { echo $port_state > /sys/class/leds/${sysfs}/port_state ;; + "morse") + echo $message > /sys/class/leds/${sysfs}/message + echo $delay > /sys/class/leds/${sysfs}/delay + ;; + switch[0-9]*) local port_mask |