led: add MODE_FLASH

This commit is contained in:
Beat Küng
2017-10-05 13:14:24 +02:00
committed by Lorenz Meier
parent 263b7ea009
commit cdf17c5447
4 changed files with 73 additions and 14 deletions
@@ -82,6 +82,7 @@ $ led_control blink -c blue -l 0 -n 5
PRINT_MODULE_USAGE_PARAM_INT('n', 3, 1, 20, "Number of blinks", true);
PRINT_MODULE_USAGE_PARAM_STRING('s', "normal", "fast|normal|slow", "Set blinking speed", true);
PRINT_MODULE_USAGE_COMMAND_DESCR("breathe", "Continuously fade LED in & out");
PRINT_MODULE_USAGE_COMMAND_DESCR("flash", "Two fast blinks and then off with frequency of 1Hz");
PRINT_MODULE_USAGE_PARAM_COMMENT("The following arguments apply to all of the above commands except for 'test':");
PRINT_MODULE_USAGE_PARAM_STRING('c', "white", "red|blue|green|yellow|purple|amber|cyan|white", "color", true);
@@ -259,6 +260,9 @@ led_control_main(int argc, char *argv[])
} else if (!strcmp(argv[myoptind], "breathe")) {
led_control.mode = led_control_s::MODE_BREATHE;
} else if (!strcmp(argv[myoptind], "flash")) {
led_control.mode = led_control_s::MODE_FLASH;
} else {
usage();
return 1;