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:
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"

View File

@ -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 .

View File

@ -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---

View File

@ -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 <usecs>:\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, "\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;

View File

@ -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---

View File

@ -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)&notify));
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 */

View File

@ -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

View File

@ -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

View File

@ -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