Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
SVN-Revision: 46341
config_get port_state $1 port_state
config_get delay $1 delay "150"
config_get message $1 message ""
+ config_get gpio $1 gpio "0"
+ config_get inverted $1 inverted "0"
if [ "$trigger" = "rssi" ]; then
# handled by rssileds userspace process
echo $delay > /sys/class/leds/${sysfs}/delay
;;
+ "gpio")
+ echo $gpio > /sys/class/leds/${sysfs}/gpio
+ echo $inverted > /sys/class/leds/${sysfs}/inverted
+ ;;
+
switch[0-9]*)
local port_mask
UCIDEF_LEDS_CHANGED=1
}
+ucidef_set_led_trigger_gpio() {
+ local cfg="led_$1"
+ local name=$2
+ local sysfs=$3
+ local gpio=$4
+ local inverted=$5
+
+ uci -q get system.$cfg && return 0
+
+ uci batch <<EOF
+set system.$cfg='led'
+set system.$cfg.name='$name'
+set system.$cfg.sysfs='$sysfs'
+set system.$cfg.trigger='gpio'
+set system.$cfg.gpio='$gpio'
+set system.$cfg.inverted='$inverted'
+EOF
+ UCIDEF_LEDS_CHANGED=1
+}
+
ucidef_set_rssimon() {
local dev="$1"
local refresh="$2"