examples/: Correct naming of some configuration variables.

This commit is contained in:
Gregory Nutt 2017-08-24 13:37:36 -06:00
parent 3367bde8fe
commit 7fa2bd1a23
9 changed files with 51 additions and 51 deletions

View File

@ -2033,11 +2033,11 @@ examples/timer
Example configuration: 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" 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 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 microseconds. Default: 10000
CONFIG_EXAMPLES_TIMER_APPNAME - This is the name of the built-in CONFIG_EXAMPLES_TIMER_APPNAME - This is the name of the built-in
application: Default: "timer" application: Default: "timer"

View File

@ -86,8 +86,8 @@ else
TARG_INSTALL_DIR = $(BIN_DIR) TARG_INSTALL_DIR = $(BIN_DIR)
endif endif
CONFIG_EXAMPLE_BRIDGE_PROGNAME ?= bridge$(EXEEXT) CONFIG_EXAMPLES_BRIDGE_PROGNAME ?= bridge$(EXEEXT)
TARG_PROGNAME = $(CONFIG_EXAMPLE_BRIDGE_PROGNAME) TARG_PROGNAME = $(CONFIG_EXAMPLES_BRIDGE_PROGNAME)
ROOTDEPPATH = --dep-path . ROOTDEPPATH = --dep-path .

View File

@ -12,21 +12,21 @@ config EXAMPLES_ONESHOT
if EXAMPLES_ONESHOT if EXAMPLES_ONESHOT
config EXAMPLE_ONESHOT_DEVNAME config EXAMPLES_ONESHOT_DEVNAME
string "Oneshot time device name" string "Oneshot time device name"
default "/dev/oneshot" default "/dev/oneshot"
---help--- ---help---
This is the default name of the timer device that will be tested if This is the default name of the timer device that will be tested if
one is not specified on the command line. one is not specified on the command line.
config EXAMPLE_ONESHOT_DELAY config EXAMPLES_ONESHOT_DELAY
int "Sample delay (microseconds)" int "Sample delay (microseconds)"
default 100000 default 100000
---help--- ---help---
This is the default delay samples in microseconds if one is not This is the default delay samples in microseconds if one is not
specified on the command line specified on the command line
config EXAMPLE_ONESHOT_SIGNO config EXAMPLES_ONESHOT_SIGNO
int "Signal number" int "Signal number"
default 13 default 13
---help--- ---help---

View File

@ -54,16 +54,16 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_EXAMPLE_ONESHOT_DEVNAME #ifndef CONFIG_EXAMPLES_ONESHOT_DEVNAME
# define CONFIG_EXAMPLE_ONESHOT_DEVNAME "/dev/oneshot" # define CONFIG_EXAMPLES_ONESHOT_DEVNAME "/dev/oneshot"
#endif #endif
#ifndef CONFIG_EXAMPLE_ONESHOT_DELAY #ifndef CONFIG_EXAMPLES_ONESHOT_DELAY
# define CONFIG_EXAMPLE_ONESHOT_DELAY 100000 # define CONFIG_EXAMPLES_ONESHOT_DELAY 100000
#endif #endif
#ifndef CONFIG_EXAMPLE_ONESHOT_SIGNO #ifndef CONFIG_EXAMPLES_ONESHOT_SIGNO
# define CONFIG_EXAMPLE_ONESHOT_SIGNO 13 # define CONFIG_EXAMPLES_ONESHOT_SIGNO 13
#endif #endif
/* For long delays that have to be broken into segments, some loss of /* 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, "Where:\n");
fprintf(stderr, "\t-d <usecs>:\n"); fprintf(stderr, "\t-d <usecs>:\n");
fprintf(stderr, "\tSpecifies the oneshot delay in microseconds. Default %ld\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<devname>:\n"); fprintf(stderr, "\t<devname>:\n");
fprintf(stderr, "\tSpecifies the path to the oneshot driver. Default %s\n", fprintf(stderr, "\tSpecifies the path to the oneshot driver. Default %s\n",
CONFIG_EXAMPLE_ONESHOT_DEVNAME); CONFIG_EXAMPLES_ONESHOT_DEVNAME);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -112,8 +112,8 @@ int main(int argc, FAR char *argv[])
int oneshot_main(int argc, char *argv[]) int oneshot_main(int argc, char *argv[])
#endif #endif
{ {
FAR const char *devname = CONFIG_EXAMPLE_ONESHOT_DEVNAME; FAR const char *devname = CONFIG_EXAMPLES_ONESHOT_DEVNAME;
unsigned long usecs = CONFIG_EXAMPLE_ONESHOT_DELAY; unsigned long usecs = CONFIG_EXAMPLES_ONESHOT_DELAY;
unsigned long secs; unsigned long secs;
struct oneshot_start_s start; struct oneshot_start_s start;
struct timespec ts; struct timespec ts;
@ -192,7 +192,7 @@ int oneshot_main(int argc, char *argv[])
/* Start the oneshot timer */ /* Start the oneshot timer */
sigemptyset(&set); sigemptyset(&set);
sigaddset(&set, CONFIG_EXAMPLE_ONESHOT_SIGNO); sigaddset(&set, CONFIG_EXAMPLES_ONESHOT_SIGNO);
if (usecs < maxus) if (usecs < maxus)
{ {
@ -202,7 +202,7 @@ int oneshot_main(int argc, char *argv[])
usecs); usecs);
start.pid = 0; start.pid = 0;
start.signo = CONFIG_EXAMPLE_ONESHOT_SIGNO; start.signo = CONFIG_EXAMPLES_ONESHOT_SIGNO;
start.arg = NULL; start.arg = NULL;
secs = usecs / 1000000; secs = usecs / 1000000;

View File

@ -12,31 +12,31 @@ config EXAMPLES_TIMER
if EXAMPLES_TIMER if EXAMPLES_TIMER
config EXAMPLE_TIMER_DEVNAME config EXAMPLES_TIMER_DEVNAME
string "Timer device name" string "Timer device name"
default "/dev/timer0" default "/dev/timer0"
---help--- ---help---
This is the name of the timer device that will be tested. This is the name of the timer device that will be tested.
config EXAMPLE_TIMER_INTERVAL config EXAMPLES_TIMER_INTERVAL
int "Timer interval (microseconds)" int "Timer interval (microseconds)"
default 1000000 default 1000000
---help--- ---help---
This is the timer interval in microseconds. This is the timer interval in microseconds.
config EXAMPLE_TIMER_DELAY config EXAMPLES_TIMER_DELAY
int "Sample delay (microseconds)" int "Sample delay (microseconds)"
default 100000 default 100000
---help--- ---help---
This is the delay between timer samples in microseconds This is the delay between timer samples in microseconds
config EXAMPLE_TIMER_NSAMPLES config EXAMPLES_TIMER_NSAMPLES
int "Number of samples" int "Number of samples"
default 20 default 20
---help--- ---help---
This is the number of timer samples that will be collected This is the number of timer samples that will be collected
config EXAMPLE_TIMER_SIGNO config EXAMPLES_TIMER_SIGNO
int "Notification signal number" int "Notification signal number"
default 17 default 17
---help--- ---help---

View File

@ -52,24 +52,24 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_EXAMPLE_TIMER_DEVNAME #ifndef CONFIG_EXAMPLES_TIMER_DEVNAME
# define CONFIG_EXAMPLE_TIMER_DEVNAME "/dev/timer0" # define CONFIG_EXAMPLES_TIMER_DEVNAME "/dev/timer0"
#endif #endif
#ifndef CONFIG_EXAMPLE_TIMER_INTERVAL #ifndef CONFIG_EXAMPLES_TIMER_INTERVAL
# define CONFIG_EXAMPLE_TIMER_INTERVAL 1000000 # define CONFIG_EXAMPLES_TIMER_INTERVAL 1000000
#endif #endif
#ifndef CONFIG_EXAMPLE_TIMER_DELAY #ifndef CONFIG_EXAMPLES_TIMER_DELAY
# define CONFIG_EXAMPLE_TIMER_DELAY 100000 # define CONFIG_EXAMPLES_TIMER_DELAY 100000
#endif #endif
#ifndef CONFIG_EXAMPLE_TIMER_NSAMPLES #ifndef CONFIG_EXAMPLES_TIMER_NSAMPLES
# define CONFIG_EXAMPLE_TIMER_NSAMPLES 20 # define CONFIG_EXAMPLES_TIMER_NSAMPLES 20
#endif #endif
#ifndef CONFIG_EXAMPLE_TIMER_SIGNO #ifndef CONFIG_EXAMPLES_TIMER_SIGNO
# define CONFIG_EXAMPLE_TIMER_SIGNO 17 # define CONFIG_EXAMPLES_TIMER_SIGNO 17
#endif #endif
/**************************************************************************** /****************************************************************************
@ -149,13 +149,13 @@ int timer_main(int argc, char *argv[])
/* Open the timer device */ /* 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) if (fd < 0)
{ {
fprintf(stderr, "ERROR: Failed to open %s: %d\n", fprintf(stderr, "ERROR: Failed to open %s: %d\n",
CONFIG_EXAMPLE_TIMER_DEVNAME, errno); CONFIG_EXAMPLES_TIMER_DEVNAME, errno);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
@ -166,9 +166,9 @@ int timer_main(int argc, char *argv[])
/* Set the timer interval */ /* Set the timer interval */
printf("Set timer interval to %lu\n", 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) if (ret < 0)
{ {
fprintf(stderr, "ERROR: Failed to set the timer interval: %d\n", errno); 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; act.sa_flags = SA_SIGINFO;
(void)sigfillset(&act.sa_mask); (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) if (ret != OK)
{ {
fprintf(stderr, "ERROR: Fsigaction failed: %d\n", errno); fprintf(stderr, "ERROR: Fsigaction failed: %d\n", errno);
@ -211,7 +211,7 @@ int timer_main(int argc, char *argv[])
notify.arg = NULL; notify.arg = NULL;
notify.pid = getpid(); notify.pid = getpid();
notify.signo = CONFIG_EXAMPLE_TIMER_SIGNO; notify.signo = CONFIG_EXAMPLES_TIMER_SIGNO;
ret = ioctl(fd, TCIOC_NOTIFICATION, (unsigned long)((uintptr_t)&notify)); ret = ioctl(fd, TCIOC_NOTIFICATION, (unsigned long)((uintptr_t)&notify));
if (ret < 0) if (ret < 0)
@ -239,9 +239,9 @@ int timer_main(int argc, char *argv[])
/* Wait a bit showing timer status */ /* 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); timer_status(fd);
} }
@ -260,7 +260,7 @@ int timer_main(int argc, char *argv[])
/* Detach the signal handler */ /* Detach the signal handler */
act.sa_handler = SIG_DFL; 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 */ /* Show the timer status before starting */

View File

@ -6,7 +6,7 @@
config EXAMPLES_ZEROCROSS config EXAMPLES_ZEROCROSS
bool "Zero Cross Detection example" bool "Zero Cross Detection example"
default n default n
depends on ZEROCROSS && !DISABLE_SIGNALS depends on SENSORS_ZEROCROSS && !DISABLE_SIGNALS
---help--- ---help---
Enable the zero cross detection example Enable the zero cross detection example

View File

@ -41,8 +41,8 @@ ASRCS =
CSRCS = CSRCS =
MAINSRC = zerocross_main.c MAINSRC = zerocross_main.c
CONFIG_ZEROCROSS_PROGNAME ?= zerocross$(EXEEXT) CONFIG_EXAMPLES_ZEROCROSS_PROGNAME ?= zerocross$(EXEEXT)
PROGNAME = $(CONFIG_ZEROCROSS_PROGNAME) PROGNAME = $(CONFIG_EXAMPLES_ZEROCROSS_PROGNAME)
# Buttons built-in application info # Buttons built-in application info

View File

@ -53,8 +53,8 @@
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/ /* Configuration ************************************************************/
#ifndef CONFIG_ZEROCROSS #ifndef CONFIG_SENSORS_ZEROCROSS
# error "CONFIG_ZEROCROSS is not defined in the configuration" # error "CONFIG_SENSORS_ZEROCROSS is not defined in the configuration"
#endif #endif
#ifndef CONFIG_EXAMPLES_ZEROCROSS_DEVNAME #ifndef CONFIG_EXAMPLES_ZEROCROSS_DEVNAME