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> SVN-Revision: 47731
This commit is contained in:
parent
4615944c71
commit
ac9bed4bc0
2 changed files with 30 additions and 0 deletions
|
@ -236,6 +236,16 @@ generate_led() {
|
||||||
set system.$cfg.port_mask='$port_mask'
|
set system.$cfg.port_mask='$port_mask'
|
||||||
EOF
|
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
|
esac
|
||||||
|
|
||||||
json_select ..
|
json_select ..
|
||||||
|
|
|
@ -422,6 +422,26 @@ ucidef_set_led_ide() {
|
||||||
json_select ..
|
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() {
|
ucidef_set_led_rssi() {
|
||||||
local cfg="led_$1"
|
local cfg="led_$1"
|
||||||
local name="$2"
|
local name="$2"
|
||||||
|
|
Loading…
Reference in a new issue