From fb5bcf08378fdac215142bc2e52fd1a15d378e2f Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Wed, 31 Aug 2016 18:57:37 +0200 Subject: [PATCH] Add two simple, custom commands: led{on,off} --- u-boot/common/cmd_custom.c | 22 ++++++++++++++++++++++ u-boot/include/configs/qca9k_common.h | 25 +++++++++++++------------ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/u-boot/common/cmd_custom.c b/u-boot/common/cmd_custom.c index 3e50032..397984d 100644 --- a/u-boot/common/cmd_custom.c +++ b/u-boot/common/cmd_custom.c @@ -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 */ diff --git a/u-boot/include/configs/qca9k_common.h b/u-boot/include/configs/qca9k_common.h index 9ff25c9..bbc2262 100644 --- a/u-boot/include/configs/qca9k_common.h +++ b/u-boot/include/configs/qca9k_common.h @@ -100,23 +100,24 @@ #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 -- 2.25.1