From 7fa2bd1a23098a9010c2a361e770b41f5ba922f1 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 24 Aug 2017 13:37:36 -0600 Subject: [PATCH] examples/: Correct naming of some configuration variables. --- examples/README.txt | 6 ++--- examples/bridge/Makefile | 4 +-- examples/oneshot/Kconfig | 6 ++--- examples/oneshot/oneshot_main.c | 24 ++++++++--------- examples/timer/Kconfig | 10 +++---- examples/timer/timer_main.c | 42 ++++++++++++++--------------- examples/zerocross/Kconfig | 2 +- examples/zerocross/Makefile | 4 +-- examples/zerocross/zerocross_main.c | 4 +-- 9 files changed, 51 insertions(+), 51 deletions(-) diff --git a/examples/README.txt b/examples/README.txt index 3ddeaa8f7..6bb380bbb 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -2033,11 +2033,11 @@ examples/timer Example configuration: - CONFIG_EXAMPLE_TIMER_DEVNAME - This is the name of the timer device that + CONFIG_EXAMPLES_TIMER_DEVNAME - This is the name of the timer device that will be tested. Default: "/dev/timer0" - CONFIG_EXAMPLE_TIMER_INTERVAL - This is the timer interval in + CONFIG_EXAMPLES_TIMER_INTERVAL - This is the timer interval in microseconds. Default: 1000000 - CONFIG_EXAMPLE_TIMER_DELAY - This is the delay between timer samples in + CONFIG_EXAMPLES_TIMER_DELAY - This is the delay between timer samples in microseconds. Default: 10000 CONFIG_EXAMPLES_TIMER_APPNAME - This is the name of the built-in application: Default: "timer" diff --git a/examples/bridge/Makefile b/examples/bridge/Makefile index 1dfed26ac..c07a6a067 100644 --- a/examples/bridge/Makefile +++ b/examples/bridge/Makefile @@ -86,8 +86,8 @@ else TARG_INSTALL_DIR = $(BIN_DIR) endif -CONFIG_EXAMPLE_BRIDGE_PROGNAME ?= bridge$(EXEEXT) -TARG_PROGNAME = $(CONFIG_EXAMPLE_BRIDGE_PROGNAME) +CONFIG_EXAMPLES_BRIDGE_PROGNAME ?= bridge$(EXEEXT) +TARG_PROGNAME = $(CONFIG_EXAMPLES_BRIDGE_PROGNAME) ROOTDEPPATH = --dep-path . diff --git a/examples/oneshot/Kconfig b/examples/oneshot/Kconfig index d1be8a500..31e696a22 100644 --- a/examples/oneshot/Kconfig +++ b/examples/oneshot/Kconfig @@ -12,21 +12,21 @@ config EXAMPLES_ONESHOT if EXAMPLES_ONESHOT -config EXAMPLE_ONESHOT_DEVNAME +config EXAMPLES_ONESHOT_DEVNAME string "Oneshot time device name" default "/dev/oneshot" ---help--- This is the default name of the timer device that will be tested if one is not specified on the command line. -config EXAMPLE_ONESHOT_DELAY +config EXAMPLES_ONESHOT_DELAY int "Sample delay (microseconds)" default 100000 ---help--- This is the default delay samples in microseconds if one is not specified on the command line -config EXAMPLE_ONESHOT_SIGNO +config EXAMPLES_ONESHOT_SIGNO int "Signal number" default 13 ---help--- diff --git a/examples/oneshot/oneshot_main.c b/examples/oneshot/oneshot_main.c index 8747f79c9..74dfdf3e4 100644 --- a/examples/oneshot/oneshot_main.c +++ b/examples/oneshot/oneshot_main.c @@ -54,16 +54,16 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef CONFIG_EXAMPLE_ONESHOT_DEVNAME -# define CONFIG_EXAMPLE_ONESHOT_DEVNAME "/dev/oneshot" +#ifndef CONFIG_EXAMPLES_ONESHOT_DEVNAME +# define CONFIG_EXAMPLES_ONESHOT_DEVNAME "/dev/oneshot" #endif -#ifndef CONFIG_EXAMPLE_ONESHOT_DELAY -# define CONFIG_EXAMPLE_ONESHOT_DELAY 100000 +#ifndef CONFIG_EXAMPLES_ONESHOT_DELAY +# define CONFIG_EXAMPLES_ONESHOT_DELAY 100000 #endif -#ifndef CONFIG_EXAMPLE_ONESHOT_SIGNO -# define CONFIG_EXAMPLE_ONESHOT_SIGNO 13 +#ifndef CONFIG_EXAMPLES_ONESHOT_SIGNO +# define CONFIG_EXAMPLES_ONESHOT_SIGNO 13 #endif /* For long delays that have to be broken into segments, some loss of @@ -91,10 +91,10 @@ static void show_usage(FAR const char *progname) fprintf(stderr, "Where:\n"); fprintf(stderr, "\t-d :\n"); fprintf(stderr, "\tSpecifies the oneshot delay in microseconds. Default %ld\n", - (unsigned long)CONFIG_EXAMPLE_ONESHOT_DELAY); + (unsigned long)CONFIG_EXAMPLES_ONESHOT_DELAY); fprintf(stderr, "\t:\n"); fprintf(stderr, "\tSpecifies the path to the oneshot driver. Default %s\n", - CONFIG_EXAMPLE_ONESHOT_DEVNAME); + CONFIG_EXAMPLES_ONESHOT_DEVNAME); exit(EXIT_FAILURE); } @@ -112,8 +112,8 @@ int main(int argc, FAR char *argv[]) int oneshot_main(int argc, char *argv[]) #endif { - FAR const char *devname = CONFIG_EXAMPLE_ONESHOT_DEVNAME; - unsigned long usecs = CONFIG_EXAMPLE_ONESHOT_DELAY; + FAR const char *devname = CONFIG_EXAMPLES_ONESHOT_DEVNAME; + unsigned long usecs = CONFIG_EXAMPLES_ONESHOT_DELAY; unsigned long secs; struct oneshot_start_s start; struct timespec ts; @@ -192,7 +192,7 @@ int oneshot_main(int argc, char *argv[]) /* Start the oneshot timer */ sigemptyset(&set); - sigaddset(&set, CONFIG_EXAMPLE_ONESHOT_SIGNO); + sigaddset(&set, CONFIG_EXAMPLES_ONESHOT_SIGNO); if (usecs < maxus) { @@ -202,7 +202,7 @@ int oneshot_main(int argc, char *argv[]) usecs); start.pid = 0; - start.signo = CONFIG_EXAMPLE_ONESHOT_SIGNO; + start.signo = CONFIG_EXAMPLES_ONESHOT_SIGNO; start.arg = NULL; secs = usecs / 1000000; diff --git a/examples/timer/Kconfig b/examples/timer/Kconfig index efe89fb03..7420164ac 100644 --- a/examples/timer/Kconfig +++ b/examples/timer/Kconfig @@ -12,31 +12,31 @@ config EXAMPLES_TIMER if EXAMPLES_TIMER -config EXAMPLE_TIMER_DEVNAME +config EXAMPLES_TIMER_DEVNAME string "Timer device name" default "/dev/timer0" ---help--- This is the name of the timer device that will be tested. -config EXAMPLE_TIMER_INTERVAL +config EXAMPLES_TIMER_INTERVAL int "Timer interval (microseconds)" default 1000000 ---help--- This is the timer interval in microseconds. -config EXAMPLE_TIMER_DELAY +config EXAMPLES_TIMER_DELAY int "Sample delay (microseconds)" default 100000 ---help--- This is the delay between timer samples in microseconds -config EXAMPLE_TIMER_NSAMPLES +config EXAMPLES_TIMER_NSAMPLES int "Number of samples" default 20 ---help--- This is the number of timer samples that will be collected -config EXAMPLE_TIMER_SIGNO +config EXAMPLES_TIMER_SIGNO int "Notification signal number" default 17 ---help--- diff --git a/examples/timer/timer_main.c b/examples/timer/timer_main.c index 5e79e5d79..5cc0c91ee 100644 --- a/examples/timer/timer_main.c +++ b/examples/timer/timer_main.c @@ -52,24 +52,24 @@ * Pre-processor Definitions ****************************************************************************/ -#ifndef CONFIG_EXAMPLE_TIMER_DEVNAME -# define CONFIG_EXAMPLE_TIMER_DEVNAME "/dev/timer0" +#ifndef CONFIG_EXAMPLES_TIMER_DEVNAME +# define CONFIG_EXAMPLES_TIMER_DEVNAME "/dev/timer0" #endif -#ifndef CONFIG_EXAMPLE_TIMER_INTERVAL -# define CONFIG_EXAMPLE_TIMER_INTERVAL 1000000 +#ifndef CONFIG_EXAMPLES_TIMER_INTERVAL +# define CONFIG_EXAMPLES_TIMER_INTERVAL 1000000 #endif -#ifndef CONFIG_EXAMPLE_TIMER_DELAY -# define CONFIG_EXAMPLE_TIMER_DELAY 100000 +#ifndef CONFIG_EXAMPLES_TIMER_DELAY +# define CONFIG_EXAMPLES_TIMER_DELAY 100000 #endif -#ifndef CONFIG_EXAMPLE_TIMER_NSAMPLES -# define CONFIG_EXAMPLE_TIMER_NSAMPLES 20 +#ifndef CONFIG_EXAMPLES_TIMER_NSAMPLES +# define CONFIG_EXAMPLES_TIMER_NSAMPLES 20 #endif -#ifndef CONFIG_EXAMPLE_TIMER_SIGNO -# define CONFIG_EXAMPLE_TIMER_SIGNO 17 +#ifndef CONFIG_EXAMPLES_TIMER_SIGNO +# define CONFIG_EXAMPLES_TIMER_SIGNO 17 #endif /**************************************************************************** @@ -149,13 +149,13 @@ int timer_main(int argc, char *argv[]) /* Open the timer device */ - printf("Open %s\n", CONFIG_EXAMPLE_TIMER_DEVNAME); + printf("Open %s\n", CONFIG_EXAMPLES_TIMER_DEVNAME); - fd = open(CONFIG_EXAMPLE_TIMER_DEVNAME, O_RDONLY); + fd = open(CONFIG_EXAMPLES_TIMER_DEVNAME, O_RDONLY); if (fd < 0) { fprintf(stderr, "ERROR: Failed to open %s: %d\n", - CONFIG_EXAMPLE_TIMER_DEVNAME, errno); + CONFIG_EXAMPLES_TIMER_DEVNAME, errno); return EXIT_FAILURE; } @@ -166,9 +166,9 @@ int timer_main(int argc, char *argv[]) /* Set the timer interval */ printf("Set timer interval to %lu\n", - (unsigned long)CONFIG_EXAMPLE_TIMER_INTERVAL); + (unsigned long)CONFIG_EXAMPLES_TIMER_INTERVAL); - ret = ioctl(fd, TCIOC_SETTIMEOUT, CONFIG_EXAMPLE_TIMER_INTERVAL); + ret = ioctl(fd, TCIOC_SETTIMEOUT, CONFIG_EXAMPLES_TIMER_INTERVAL); if (ret < 0) { fprintf(stderr, "ERROR: Failed to set the timer interval: %d\n", errno); @@ -192,9 +192,9 @@ int timer_main(int argc, char *argv[]) act.sa_flags = SA_SIGINFO; (void)sigfillset(&act.sa_mask); - (void)sigdelset(&act.sa_mask, CONFIG_EXAMPLE_TIMER_SIGNO); + (void)sigdelset(&act.sa_mask, CONFIG_EXAMPLES_TIMER_SIGNO); - ret = sigaction(CONFIG_EXAMPLE_TIMER_SIGNO, &act, NULL); + ret = sigaction(CONFIG_EXAMPLES_TIMER_SIGNO, &act, NULL); if (ret != OK) { fprintf(stderr, "ERROR: Fsigaction failed: %d\n", errno); @@ -211,7 +211,7 @@ int timer_main(int argc, char *argv[]) notify.arg = NULL; notify.pid = getpid(); - notify.signo = CONFIG_EXAMPLE_TIMER_SIGNO; + notify.signo = CONFIG_EXAMPLES_TIMER_SIGNO; ret = ioctl(fd, TCIOC_NOTIFICATION, (unsigned long)((uintptr_t)¬ify)); if (ret < 0) @@ -239,9 +239,9 @@ int timer_main(int argc, char *argv[]) /* Wait a bit showing timer status */ - for (i = 0; i < CONFIG_EXAMPLE_TIMER_NSAMPLES; i++) + for (i = 0; i < CONFIG_EXAMPLES_TIMER_NSAMPLES; i++) { - usleep(CONFIG_EXAMPLE_TIMER_DELAY); + usleep(CONFIG_EXAMPLES_TIMER_DELAY); timer_status(fd); } @@ -260,7 +260,7 @@ int timer_main(int argc, char *argv[]) /* Detach the signal handler */ act.sa_handler = SIG_DFL; - (void)sigaction(CONFIG_EXAMPLE_TIMER_SIGNO, &act, NULL); + (void)sigaction(CONFIG_EXAMPLES_TIMER_SIGNO, &act, NULL); /* Show the timer status before starting */ diff --git a/examples/zerocross/Kconfig b/examples/zerocross/Kconfig index 541da9fa8..f17d49374 100644 --- a/examples/zerocross/Kconfig +++ b/examples/zerocross/Kconfig @@ -6,7 +6,7 @@ config EXAMPLES_ZEROCROSS bool "Zero Cross Detection example" default n - depends on ZEROCROSS && !DISABLE_SIGNALS + depends on SENSORS_ZEROCROSS && !DISABLE_SIGNALS ---help--- Enable the zero cross detection example diff --git a/examples/zerocross/Makefile b/examples/zerocross/Makefile index 6d79faa05..2cfc916ee 100644 --- a/examples/zerocross/Makefile +++ b/examples/zerocross/Makefile @@ -41,8 +41,8 @@ ASRCS = CSRCS = MAINSRC = zerocross_main.c -CONFIG_ZEROCROSS_PROGNAME ?= zerocross$(EXEEXT) -PROGNAME = $(CONFIG_ZEROCROSS_PROGNAME) +CONFIG_EXAMPLES_ZEROCROSS_PROGNAME ?= zerocross$(EXEEXT) +PROGNAME = $(CONFIG_EXAMPLES_ZEROCROSS_PROGNAME) # Buttons built-in application info diff --git a/examples/zerocross/zerocross_main.c b/examples/zerocross/zerocross_main.c index 40d7b1152..2a7efcc15 100644 --- a/examples/zerocross/zerocross_main.c +++ b/examples/zerocross/zerocross_main.c @@ -53,8 +53,8 @@ ****************************************************************************/ /* Configuration ************************************************************/ -#ifndef CONFIG_ZEROCROSS -# error "CONFIG_ZEROCROSS is not defined in the configuration" +#ifndef CONFIG_SENSORS_ZEROCROSS +# error "CONFIG_SENSORS_ZEROCROSS is not defined in the configuration" #endif #ifndef CONFIG_EXAMPLES_ZEROCROSS_DEVNAME