summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-11-25 17:20:49 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-11-25 17:20:49 +0000
commit38fced86eeed50fc6e841f5b8f3abd285a286117 (patch)
treeacf3d1987621088d58dbd17d1ed1f127960d8a55 /package
parentefd00e6240c959e9639a5e5bc964192adfef809f (diff)
downloadmtk-20170518-38fced86eeed50fc6e841f5b8f3abd285a286117.zip
mtk-20170518-38fced86eeed50fc6e841f5b8f3abd285a286117.tar.gz
mtk-20170518-38fced86eeed50fc6e841f5b8f3abd285a286117.tar.bz2
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> SVN-Revision: 34380
Diffstat (limited to 'package')
-rw-r--r--package/base-files/Makefile2
-rwxr-xr-xpackage/base-files/files/etc/init.d/led7
2 files changed, 8 insertions, 1 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 972f96b..7a2e216 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files
-PKG_RELEASE:=119
+PKG_RELEASE:=120
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led
index f3f3c3f..729796b 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