diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 22:27:02 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-03 22:27:02 +0000 |
commit | fd83873d6440d699fee4277151729e2c0ebbdc6d (patch) | |
tree | d26918aa02e54bfd3c647c1c9cafa48098159dba | |
parent | ef8c10db877cd2dd3b5c3c259b094e11b3fb46e3 (diff) | |
download | master-187ad058-fd83873d6440d699fee4277151729e2c0ebbdc6d.tar.gz master-187ad058-fd83873d6440d699fee4277151729e2c0ebbdc6d.tar.bz2 master-187ad058-fd83873d6440d699fee4277151729e2c0ebbdc6d.zip |
base-files: board.d: support timer leds
Add ucidef_set_led_timer() and handling for it to config_generate.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47731 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rwxr-xr-x | package/base-files/files/bin/config_generate | 10 | ||||
-rwxr-xr-x | package/base-files/files/lib/functions/uci-defaults-new.sh | 20 |
2 files changed, 30 insertions, 0 deletions
diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 7e0e2acd3b..264f7d3ed1 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -236,6 +236,16 @@ generate_led() { set system.$cfg.port_mask='$port_mask' EOF ;; + + timer) + local delayon delayoff + json_get_vars delayon delayoff + uci -q batch <<-EOF + set system.$cfg.trigger='timer' + set system.$cfg.delayon='$delayon' + set system.$cfg.delayoff='$delayoff' + EOF + ;; esac json_select .. diff --git a/package/base-files/files/lib/functions/uci-defaults-new.sh b/package/base-files/files/lib/functions/uci-defaults-new.sh index 37978a839a..9fa3fa204e 100755 --- a/package/base-files/files/lib/functions/uci-defaults-new.sh +++ b/package/base-files/files/lib/functions/uci-defaults-new.sh @@ -422,6 +422,26 @@ ucidef_set_led_ide() { json_select .. } +ucidef_set_led_timer() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local delayon="$4" + local delayoff="$5" + + json_select_object led + + json_select_object "$1" + json_add_string type timer + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_int delayon "$delayon" + json_add_int delayoff "$delayoff" + json_select .. + + json_select .. +} + ucidef_set_led_rssi() { local cfg="led_$1" local name="$2" |