diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-04 15:02:32 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2015-12-04 15:02:32 +0000 |
commit | 08078df83dc2ec61e2272c2abf105d28ae44681c (patch) | |
tree | a7e8f92f9936aed540864f15a8ef1cceb45ec4bf /package/base-files/files/lib | |
parent | ba8a44995fe321bfc57a61fdb2a82cabd7605e94 (diff) | |
download | upstream-08078df83dc2ec61e2272c2abf105d28ae44681c.tar.gz upstream-08078df83dc2ec61e2272c2abf105d28ae44681c.tar.bz2 upstream-08078df83dc2ec61e2272c2abf105d28ae44681c.zip |
board.d: add support for gpio_switch sections
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 47762
Diffstat (limited to 'package/base-files/files/lib')
-rwxr-xr-x | package/base-files/files/lib/functions/uci-defaults-new.sh | 15 |
1 files changed, 15 insertions, 0 deletions
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 61aa6e168e..de3f180cbb 100755 --- a/package/base-files/files/lib/functions/uci-defaults-new.sh +++ b/package/base-files/files/lib/functions/uci-defaults-new.sh @@ -540,6 +540,21 @@ ucidef_set_rssimon() { } +ucidef_add_gpio_switch() { + local cfg="$1" + local name="$2" + local pin="$3" + local default="${4:-0}" + + json_select_object gpioswitch + json_select_object "$cfg" + json_add_string name "$name" + json_add_int pin "$pin" + json_add_int default "$default" + json_select .. + json_select .. +} + board_config_update() { json_init [ -f ${CFG} ] && json_load "$(cat ${CFG})" |