Procházet zdrojové kódy

lantiq: diag.sh with both red and green power LEDs

This provides a boot LED sequence suitable for devices with both red and
green LEDs for power. This assumes no "default-on" settings in the
device tree.

Signed-off-by: Daniel Gimpelevich <[email protected]>

SVN-Revision: 36899
John Crispin před 12 roky
rodič
revize
f7daed8b9a
1 změnil soubory, kde provedl 20 přidání a 0 odebrání
  1. 20 0
      target/linux/lantiq/base-files/etc/diag.sh

+ 20 - 0
target/linux/lantiq/base-files/etc/diag.sh

@@ -6,6 +6,26 @@
 status_led="power"
 
 set_state() {
+	[ -d /sys/class/leds/power2/ ] && {
+
+		case "$1" in
+		preinit)
+			led_set_attr "power2" "trigger" "heartbeat"
+			;;
+		init)
+			status_led_on
+			;;
+		failsafe)
+			led_off "power2"
+			status_led_set_timer 100 100
+			;;
+		done)
+			led_off "power2"
+			;;
+		esac
+		return
+	}
+
 	case "$1" in
 	preinit)
 		status_led_set_heartbeat