diff --git a/examples/rgbled/Kconfig b/examples/rgbled/Kconfig index 99ff6d372..a868f797f 100644 --- a/examples/rgbled/Kconfig +++ b/examples/rgbled/Kconfig @@ -11,6 +11,10 @@ config EXAMPLES_RGBLED if EXAMPLES_RGBLED +config EXAMPLES_RGBLED_DEVNAME + string "RGB LED device name" + default "/dev/rgbled0" + config EXAMPLES_RGBLED_PROGNAME string "Program name" default "rgbled" diff --git a/examples/rgbled/rgbled.c b/examples/rgbled/rgbled.c index 71d8cc5d4..5d84740c0 100644 --- a/examples/rgbled/rgbled.c +++ b/examples/rgbled/rgbled.c @@ -47,7 +47,9 @@ * Pre-processor Definitions ****************************************************************************/ -#define RGBLED "/dev/rgb0" +#ifndef CONFIG_EXAMPLES_RGBLED_DEVNAME +# define CONFIG_EXAMPLES_RGBLED_DEVNAME "/dev/rgbled0" +#endif /**************************************************************************** * Public Functions @@ -72,11 +74,11 @@ int rgbled_main(int argc, char *argv[]) int fd; char buffer[8]; - fd = open(RGBLED, O_WRONLY); + fd = open(CONFIG_EXAMPLES_RGBLED_DEVNAME, O_WRONLY); if (fd < 0) { - printf("Error opening %s!\n", RGBLED); + printf("Error opening %s!\n", CONFIG_EXAMPLES_RGBLED_DEVNAME); return -1; }