Add two simple, custom commands: led{on,off}
authorPiotr Dymacz <pepe2k@gmail.com>
Wed, 31 Aug 2016 16:57:37 +0000 (18:57 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Wed, 31 Aug 2016 16:57:37 +0000 (18:57 +0200)
u-boot/common/cmd_custom.c
u-boot/include/configs/qca9k_common.h

index 3e500325c2271bb3b3d833ae03280799c13a1d17..397984df9f4aa309085f495fee6cc7abc3c24ad2 100644 (file)
@@ -288,3 +288,25 @@ U_BOOT_CMD(sleep, 2, 1, do_sleep,
        "sleep for specified time\n", "ms\n"
        "\t- sleep for 'ms' number of milliseconds\n");
 #endif /* CONFIG_CMD_SLEEP */
+
+/*
+ * Turns on/off LED/s
+ */
+#if defined(CONFIG_CMD_LED)
+int do_ledon(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+       all_led_on();
+
+       return 0;
+}
+
+int do_ledoff(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
+{
+       all_led_off();
+
+       return 0;
+}
+
+U_BOOT_CMD(ledon,  1, 1, do_ledon,  "turn LED/s on\n", NULL);
+U_BOOT_CMD(ledoff, 1, 1, do_ledoff, "turn LED/s off\n", NULL);
+#endif /* CONFIG_CMD_LED */
index 9ff25c91516aeb6204b580dcce7cc9c99594c396..bbc226299dcc0efda0738396314de003ac609f93 100644 (file)
 #undef  CFG_ENV_IS_NOWHERE
 
 /* Available commands */
-#define CONFIG_CMD_MEMORY
-#define CONFIG_CMD_DHCP
-#define CONFIG_CMD_PING
-#define CONFIG_CMD_FLASH
-#define CONFIG_CMD_NET
-#define CONFIG_CMD_RUN
+#define CONFIG_CMD_BOOTD
+#define CONFIG_CMD_BUTTON
 #define CONFIG_CMD_DATE
-#define CONFIG_CMD_SNTP
+#define CONFIG_CMD_DHCP
 #define CONFIG_CMD_ECHO
-#define CONFIG_CMD_BOOTD
-#define CONFIG_CMD_ITEST
-#define CONFIG_CMD_IMI
 #define CONFIG_CMD_ENV
+#define CONFIG_CMD_FLASH
+#define CONFIG_CMD_IMI
+#define CONFIG_CMD_ITEST
+#define CONFIG_CMD_LED
 #define CONFIG_CMD_LOADB
-#define CONFIG_CMD_BUTTON
-#define CONFIG_CMD_SLEEP
+#define CONFIG_CMD_MEMORY
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_PING
+#define CONFIG_CMD_RUN
 #define CONFIG_CMD_SETEXPR
+#define CONFIG_CMD_SLEEP
+#define CONFIG_CMD_SNTP
 
 /* Simple upgrade scripts in environment */
 #define CONFIG_UPG_SCRIPTS_UBOOT