aboutsummaryrefslogtreecommitdiff
path: root/apps/examples
diff options
context:
space:
mode:
authorpx4dev <px4@purgatory.org>2012-10-13 00:08:02 -0700
committerpx4dev <px4@purgatory.org>2012-10-13 00:08:02 -0700
commit0ccaa1330bf0bcb6fd7ab6b966470f8e2f6c4275 (patch)
treede4f04aac9a97274d706d564fc61e798ac1033ab /apps/examples
parentd62ec78ab835153ef3ba480a5a4110465ba34372 (diff)
parente4ccbe7508fd31b76790986fc654dc588efb9dfe (diff)
downloadpx4-firmware-0ccaa1330bf0bcb6fd7ab6b966470f8e2f6c4275.tar.gz
px4-firmware-0ccaa1330bf0bcb6fd7ab6b966470f8e2f6c4275.tar.bz2
px4-firmware-0ccaa1330bf0bcb6fd7ab6b966470f8e2f6c4275.zip
Merge branch 'master' of file:///Users/Shared/NuttX
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5231 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples')
-rw-r--r--apps/examples/Make.defs6
-rw-r--r--apps/examples/README.txt114
-rw-r--r--apps/examples/adc/Kconfig24
-rw-r--r--apps/examples/adc/adc_main.c14
-rw-r--r--apps/examples/buttons/Kconfig52
-rw-r--r--apps/examples/buttons/buttons_main.c88
-rw-r--r--apps/examples/poll/net_listener.c10
-rw-r--r--apps/examples/poll/net_reader.c10
8 files changed, 202 insertions, 116 deletions
diff --git a/apps/examples/Make.defs b/apps/examples/Make.defs
index a6e0ae88e..d03b976d2 100644
--- a/apps/examples/Make.defs
+++ b/apps/examples/Make.defs
@@ -58,7 +58,7 @@ ifeq ($(CONFIG_EXAMPLES_DHCPD),y)
CONFIGURED_APPS += examples/dhcpd
endif
-ifeq ($(CONFIG_EXAMPLE_DISCOVER),y)
+ifeq ($(CONFIG_EXAMPLES_DISCOVER),y)
CONFIGURED_APPS += examples/discover
endif
@@ -218,6 +218,10 @@ ifeq ($(CONFIG_EXAMPLES_USBTERM),y)
CONFIGURED_APPS += examples/usbterm
endif
+ifeq ($(CONFIG_EXAMPLES_WATCHDOG),y)
+CONFIGURED_APPS += examples/watchdog
+endif
+
ifeq ($(CONFIG_EXAMPLES_WGET),y)
CONFIGURED_APPS += examples/wget
endif
diff --git a/apps/examples/README.txt b/apps/examples/README.txt
index 12d6d3892..763427e32 100644
--- a/apps/examples/README.txt
+++ b/apps/examples/README.txt
@@ -60,20 +60,20 @@ examples/buttons
This is a simple configuration that may be used to test the board-
specific button interfaces. Configuration options:
- CONFIG_ARCH_BUTTONS - Must be defined for button support
- CONFIG_EXAMPLE_BUTTONS_MIN - Lowest button number (MIN=0)
- CONFIG_EXAMPLE_BUTTONS_MAX - Highest button number (MAX=7)
+ CONFIG_ARCH_BUTTONS - Must be defined for button support
+ CONFIG_EXAMPLES_BUTTONS_MIN - Lowest button number (MIN=0)
+ CONFIG_EXAMPLES_BUTTONS_MAX - Highest button number (MAX=7)
- CONFIG_ARCH_IRQBUTTONS - Must be defined for interrupting button support
- CONFIG_EXAMPLE_IRQBUTTONS_MIN - Lowest interrupting button number (MIN=0)
- CONFIG_EXAMPLE_IRQBUTTONS_MAX - Highest interrupting button number (MAX=7)
+ CONFIG_ARCH_IRQBUTTONS - Must be defined for interrupting button support
+ CONFIG_EXAMPLES_IRQBUTTONS_MIN - Lowest interrupting button number (MIN=0)
+ CONFIG_EXAMPLES_IRQBUTTONS_MAX - Highest interrupting button number (MAX=7)
Name strings for buttons:
- CONFIG_EXAMPLE_BUTTONS_NAME0, CONFIG_EXAMPLE_BUTTONS_NAME1,
- CONFIG_EXAMPLE_BUTTONS_NAME2, CONFIG_EXAMPLE_BUTTONS_NAME3,
- CONFIG_EXAMPLE_BUTTONS_NAME4, CONFIG_EXAMPLE_BUTTONS_NAME5,
- CONFIG_EXAMPLE_BUTTONS_NAME6, CONFIG_EXAMPLE_BUTTONS_NAME7,
+ CONFIG_EXAMPLES_BUTTONS_NAME0, CONFIG_EXAMPLES_BUTTONS_NAME1,
+ CONFIG_EXAMPLES_BUTTONS_NAME2, CONFIG_EXAMPLES_BUTTONS_NAME3,
+ CONFIG_EXAMPLES_BUTTONS_NAME4, CONFIG_EXAMPLES_BUTTONS_NAME5,
+ CONFIG_EXAMPLES_BUTTONS_NAME6, CONFIG_EXAMPLES_BUTTONS_NAME7,
Additional architecture-/board- specific configuration settings may also
be required.
@@ -260,10 +260,10 @@ examples/dhcpd
configuration settings)
CONFIG_NET_BROADCAST=y - UDP broadcast support is needed.
- CONFIG_EXAMPLE_DHCPD_NOMAC - (May be defined to use software assigned MAC)
- CONFIG_EXAMPLE_DHCPD_IPADDR - Target IP address
- CONFIG_EXAMPLE_DHCPD_DRIPADDR - Default router IP addess
- CONFIG_EXAMPLE_DHCPD_NETMASK - Network mask
+ CONFIG_EXAMPLES_DHCPD_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLES_DHCPD_IPADDR - Target IP address
+ CONFIG_EXAMPLES_DHCPD_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLES_DHCPD_NETMASK - Network mask
See also CONFIG_NETUTILS_DHCPD_* settings described elsewhere
and used in netutils/dhcpd/dhcpd.c. These settings are required
@@ -291,11 +291,11 @@ examples/discover
NuttX configuration settings:
- CONFIG_EXAMPLE_DISCOVER_DHCPC - DHCP Client
- CONFIG_EXAMPLE_DISCOVER_NOMAC - Use canned MAC address
- CONFIG_EXAMPLE_DISCOVER_IPADDR - Target IP address
- CONFIG_EXAMPLE_DISCOVER_DRIPADDR - Router IP address
- CONFIG_EXAMPLE_DISCOVER_NETMASK - Network Mask
+ CONFIG_EXAMPLES_DISCOVER_DHCPC - DHCP Client
+ CONFIG_EXAMPLES_DISCOVER_NOMAC - Use canned MAC address
+ CONFIG_EXAMPLES_DISCOVER_IPADDR - Target IP address
+ CONFIG_EXAMPLES_DISCOVER_DRIPADDR - Router IP address
+ CONFIG_EXAMPLES_DISCOVER_NETMASK - Network Mask
examples/ftpc
^^^^^^^^^^^^^
@@ -367,12 +367,12 @@ examples/ftpd
If CONFIG_EXAMPLES_FTPD_NONETINIT is not defined, then the following may
be specified to customized the network configuration:
- CONFIG_EXAMPLE_FTPD_NOMAC - If the hardware has no MAC address of its
+ CONFIG_EXAMPLES_FTPD_NOMAC - If the hardware has no MAC address of its
own, define this =y to provide a bogus address for testing.
- CONFIG_EXAMPLE_FTPD_IPADDR - The target IP address. Default 10.0.0.2
- CONFIG_EXAMPLE_FTPD_DRIPADDR - The default router address. Default
+ CONFIG_EXAMPLES_FTPD_IPADDR - The target IP address. Default 10.0.0.2
+ CONFIG_EXAMPLES_FTPD_DRIPADDR - The default router address. Default
10.0.0.1
- CONFIG_EXAMPLE_FTPD_NETMASK - The network mask. Default: 255.255.255.0
+ CONFIG_EXAMPLES_FTPD_NETMASK - The network mask. Default: 255.255.255.0
Other required configuration settings: Of course TCP networking support
is required. But here are a couple that are less obvious:
@@ -465,15 +465,15 @@ examples/igmp
does not do much of value -- Much more is needed in order to verify
the IGMP features!
- * CONFIG_EXAMPLE_IGMP_NOMAC
+ * CONFIG_EXAMPLES_IGMP_NOMAC
Set if the hardware has no MAC address; one will be assigned
- * CONFIG_EXAMPLE_IGMP_IPADDR
+ * CONFIG_EXAMPLES_IGMP_IPADDR
Target board IP address
- * CONFIG_EXAMPLE_IGMP_DRIPADDR
+ * CONFIG_EXAMPLES_IGMP_DRIPADDR
Default router address
- * CONFIG_EXAMPLE_IGMP_NETMASK
+ * CONFIG_EXAMPLES_IGMP_NETMASK
Network mask
- * CONFIG_EXAMPLE_IGMP_GRPADDR
+ * CONFIG_EXAMPLES_IGMP_GRPADDR
Multicast group address
Applications using this example will need to provide an appconfig
@@ -1023,10 +1023,10 @@ examples/poll
CONFIG_NSOCKET_DESCRIPTORS - Defined to be greater than 0
CONFIG_NET_NTCP_READAHEAD_BUFFERS - Defined to be greater than zero
- CONFIG_EXAMPLE_POLL_NOMAC - (May be defined to use software assigned MAC)
- CONFIG_EXAMPLE_POLL_IPADDR - Target IP address
- CONFIG_EXAMPLE_POLL_DRIPADDR - Default router IP addess
- CONFIG_EXAMPLE_POLL_NETMASK - Network mask
+ CONFIG_EXAMPLES_POLL_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLES_POLL_IPADDR - Target IP address
+ CONFIG_EXAMPLES_POLL_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLES_POLL_NETMASK - Network mask
In order to for select to work with incoming connections, you
must also select:
@@ -1163,14 +1163,14 @@ examples/sendmail
Settings unique to this example include:
- CONFIG_EXAMPLE_SENDMAIL_NOMAC - May be defined to use software assigned MAC (optional)
- CONFIG_EXAMPLE_SENDMAIL_IPADDR - Target IP address (required)
- CONFIG_EXAMPLE_SENDMAIL_DRIPADDR - Default router IP addess (required)
- CONFIG_EXAMPLE_SENDMAILT_NETMASK - Network mask (required)
- CONFIG_EXAMPLE_SENDMAIL_RECIPIENT - The recipient of the email (required)
- CONFIG_EXAMPLE_SENDMAIL_SENDER - Optional. Default: "nuttx-testing@example.com"
- CONFIG_EXAMPLE_SENDMAIL_SUBJECT - Optional. Default: "Testing SMTP from NuttX"
- CONFIG_EXAMPLE_SENDMAIL_BODY - Optional. Default: "Test message sent by NuttX"
+ CONFIG_EXAMPLES_SENDMAIL_NOMAC - May be defined to use software assigned MAC (optional)
+ CONFIG_EXAMPLES_SENDMAIL_IPADDR - Target IP address (required)
+ CONFIG_EXAMPLES_SENDMAIL_DRIPADDR - Default router IP addess (required)
+ CONFIG_EXAMPLES_SENDMAILT_NETMASK - Network mask (required)
+ CONFIG_EXAMPLES_SENDMAIL_RECIPIENT - The recipient of the email (required)
+ CONFIG_EXAMPLES_SENDMAIL_SENDER - Optional. Default: "nuttx-testing@example.com"
+ CONFIG_EXAMPLES_SENDMAIL_SUBJECT - Optional. Default: "Testing SMTP from NuttX"
+ CONFIG_EXAMPLES_SENDMAIL_BODY - Optional. Default: "Test message sent by NuttX"
NOTE: This test has not been verified on the NuttX target environment.
As of this writing, unit-tested in the Cygwin/Linux host environment.
@@ -1213,12 +1213,12 @@ examples/telnetd
Default: SCHED_PRIORITY_DEFAULT
CONFIG_EXAMPLES_TELNETD_CLIENTSTACKSIZE - Stack size allocated for the
Telnet client. Default: 2048
- CONFIG_EXAMPLE_TELNETD_NOMAC - If the hardware has no MAC address of its
+ CONFIG_EXAMPLES_TELNETD_NOMAC - If the hardware has no MAC address of its
own, define this =y to provide a bogus address for testing.
- CONFIG_EXAMPLE_TELNETD_IPADDR - The target IP address. Default 10.0.0.2
- CONFIG_EXAMPLE_TELNETD_DRIPADDR - The default router address. Default
+ CONFIG_EXAMPLES_TELNETD_IPADDR - The target IP address. Default 10.0.0.2
+ CONFIG_EXAMPLES_TELNETD_DRIPADDR - The default router address. Default
10.0.0.1
- CONFIG_EXAMPLE_TELNETD_NETMASK - The network mask. Default: 255.255.255.0
+ CONFIG_EXAMPLES_TELNETD_NETMASK - The network mask. Default: 255.255.255.0
The appconfig file (apps/.config) should include:
@@ -1240,9 +1240,9 @@ examples/thttpd
CGI programs. see configs/README.txt for most THTTPD settings.
In addition to those, this example accepts:
- CONFIG_EXAMPLE_THTTPD_NOMAC - (May be defined to use software assigned MAC)
- CONFIG_EXAMPLE_THTTPD_DRIPADDR - Default router IP addess
- CONFIG_EXAMPLE_THTTPD_NETMASK - Network mask
+ CONFIG_EXAMPLES_THTTPD_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLES_THTTPD_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLES_THTTPD_NETMASK - Network mask
Applications using this example will need to provide an appconfig
file in the configuration directory with instruction to build applications
@@ -1335,11 +1335,11 @@ examples/uip
This is a port of uIP tiny webserver example application. Settings
specific to this example include:
- CONFIG_EXAMPLE_UIP_NOMAC - (May be defined to use software assigned MAC)
- CONFIG_EXAMPLE_UIP_IPADDR - Target IP address
- CONFIG_EXAMPLE_UIP_DRIPADDR - Default router IP addess
- CONFIG_EXAMPLE_UIP_NETMASK - Network mask
- CONFIG_EXAMPLE_UIP_DHCPC - Select to get IP address via DHCP
+ CONFIG_EXAMPLES_UIP_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLES_UIP_IPADDR - Target IP address
+ CONFIG_EXAMPLES_UIP_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLES_UIP_NETMASK - Network mask
+ CONFIG_EXAMPLES_UIP_DHCPC - Select to get IP address via DHCP
If you use DHCPC, then some special configuration network options are
required. These include:
@@ -1637,11 +1637,11 @@ examples/wget
A simple web client example. It will obtain a file from a server using the HTTP
protocol. Settings unique to this example include:
- CONFIG_EXAMPLE_WGET_URL - The URL of the file to get
- CONFIG_EXAMPLE_WGET_NOMAC - (May be defined to use software assigned MAC)
- CONFIG_EXAMPLE_WGET_IPADDR - Target IP address
- CONFIG_EXAMPLE_WGET_DRIPADDR - Default router IP addess
- CONFIG_EXAMPLE_WGET_NETMASK - Network mask
+ CONFIG_EXAMPLES_WGET_URL - The URL of the file to get
+ CONFIG_EXAMPLES_WGET_NOMAC - (May be defined to use software assigned MAC)
+ CONFIG_EXAMPLES_WGET_IPADDR - Target IP address
+ CONFIG_EXAMPLES_WGET_DRIPADDR - Default router IP addess
+ CONFIG_EXAMPLES_WGET_NETMASK - Network mask
This example uses netutils/webclient. Additional configuration settings apply
to that code as follows (but built-in defaults are probably OK):
diff --git a/apps/examples/adc/Kconfig b/apps/examples/adc/Kconfig
index b6dca047c..85c875deb 100644
--- a/apps/examples/adc/Kconfig
+++ b/apps/examples/adc/Kconfig
@@ -6,8 +6,32 @@
config EXAMPLES_ADC
bool "ADC example"
default n
+ depends on ADC
---help---
Enable the ADC example
if EXAMPLES_ADC
+
+config EXAMPLES_ADC_DEVPATH
+ string "ADC device path"
+ default "/dev/adc0"
+ ---help---
+ The default path to the ADC device. Default: /dev/adc0
+
+config EXAMPLES_ADC_NSAMPLES
+ int "Number of Sample Groups"
+ default 0
+ depends on !NSH_BUILTIN_APPS
+ ---help---
+ If NSH_BUILTIN_APPS is defined, then the number of samples is provided
+ on the command line and this value is ignored. Otherwise, this number
+ of samples is collected and the program terminates. Default: 0 (samples
+ are collected indefinitely).
+
+config EXAMPLES_ADC_GROUPSIZE
+ int "Number of Samples per Group"
+ default 4
+ ---help---
+ The number of samples to read at once. Default: 4
+
endif
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
index 4797265db..404fba8c1 100644
--- a/apps/examples/adc/adc_main.c
+++ b/apps/examples/adc/adc_main.c
@@ -57,6 +57,14 @@
* Pre-processor Definitions
****************************************************************************/
+/* Use CONFIG_EXAMPLES_ADC_NSAMPLES == 0 to mean to collect samples
+ * indefinitely.
+ */
+
+#ifndef CONFIG_EXAMPLES_ADC_NSAMPLES
+# define CONFIG_EXAMPLES_ADC_NSAMPLES 0
+#endif
+
/****************************************************************************
* Private Types
****************************************************************************/
@@ -249,7 +257,7 @@ int adc_main(int argc, char *argv[])
adc_devpath(&g_adcstate, CONFIG_EXAMPLES_ADC_DEVPATH);
-#ifdef CONFIG_EXAMPLES_ADC_NSAMPLES
+#if CONFIG_EXAMPLES_ADC_NSAMPLES > 0
g_adcstate.count = CONFIG_EXAMPLES_ADC_NSAMPLES;
#else
g_adcstate.count = 1;
@@ -267,7 +275,7 @@ int adc_main(int argc, char *argv[])
* samples that we collect before returning. Otherwise, we never return
*/
-#if defined(CONFIG_NSH_BUILTIN_APPS) || defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
+#if defined(CONFIG_NSH_BUILTIN_APPS) || CONFIG_EXAMPLES_ADC_NSAMPLES > 0
message("adc_main: g_adcstate.count: %d\n", g_adcstate.count);
#endif
@@ -290,7 +298,7 @@ int adc_main(int argc, char *argv[])
#if defined(CONFIG_NSH_BUILTIN_APPS)
for (; g_adcstate.count > 0; g_adcstate.count--)
-#elif defined(CONFIG_EXAMPLES_ADC_NSAMPLES)
+#elif CONFIG_EXAMPLES_ADC_NSAMPLES > 0
for (g_adcstate.count = 0; g_adcstate.count < CONFIG_EXAMPLES_ADC_NSAMPLES; g_adcstate.count++)
#else
for (;;)
diff --git a/apps/examples/buttons/Kconfig b/apps/examples/buttons/Kconfig
index 9c34b37bc..d145867fc 100644
--- a/apps/examples/buttons/Kconfig
+++ b/apps/examples/buttons/Kconfig
@@ -7,7 +7,57 @@ config EXAMPLES_BUTTONS
bool "Buttons example"
default n
---help---
- Enable the buttons example
+ Enable the buttons example. May require ARCH_BUTTONS on some boards.
if EXAMPLES_BUTTONS
+config EXAMPLES_BUTTONS_MIN
+int "Lowest Button Number"
+default 0
+
+config EXAMPLES_BUTTONS_MAX
+int "Highest Button Number"
+default 7
+
+if ARCH_IRQBUTTONS
+config EXAMPLES_IRQBUTTONS_MIN
+int "Lowest Interrupting Button Number"
+default 0
+
+config EXAMPLES_IRQBUTTONS_MAX
+int "Highest Interrupting Button Number"
+default 7
+
+config EXAMPLES_BUTTONS_NAME0
+string "Button 0 Name"
+default "Button 0"
+
+config EXAMPLES_BUTTONS_NAME1
+string "Button 1 Name"
+default "Button 1"
+
+config EXAMPLES_BUTTONS_NAME2
+string "Button 2 Name"
+default "Button 2"
+
+config EXAMPLES_BUTTONS_NAME3
+string "Button 3 Name"
+default "Button 3"
+
+config EXAMPLES_BUTTONS_NAME4
+string "Button 4 Name"
+default "Button 4"
+
+config EXAMPLES_BUTTONS_NAME5
+string "Button 5 Name"
+default "Button 5"
+
+config EXAMPLES_BUTTONS_NAME6
+string "Button 6 Name"
+default "Button 6"
+
+config EXAMPLES_BUTTONS_NAME7
+string "Button 7 Name"
+default "Button 7"
+
+endif
endif
diff --git a/apps/examples/buttons/buttons_main.c b/apps/examples/buttons/buttons_main.c
index a3f6449d4..5f25c1ef1 100644
--- a/apps/examples/buttons/buttons_main.c
+++ b/apps/examples/buttons/buttons_main.c
@@ -61,60 +61,60 @@
# error "CONFIG_ARCH_BUTTONS is not defined in the configuration"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME0
-# define CONFIG_EXAMPLE_BUTTONS_NAME0 "BUTTON0"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME0
+# define CONFIG_EXAMPLES_BUTTONS_NAME0 "BUTTON0"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME1
-# define CONFIG_EXAMPLE_BUTTONS_NAME1 "BUTTON1"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME1
+# define CONFIG_EXAMPLES_BUTTONS_NAME1 "BUTTON1"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME2
-# define CONFIG_EXAMPLE_BUTTONS_NAME2 "BUTTON2"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME2
+# define CONFIG_EXAMPLES_BUTTONS_NAME2 "BUTTON2"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME3
-# define CONFIG_EXAMPLE_BUTTONS_NAME3 "BUTTON3"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME3
+# define CONFIG_EXAMPLES_BUTTONS_NAME3 "BUTTON3"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME4
-# define CONFIG_EXAMPLE_BUTTONS_NAME4 "BUTTON4"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME4
+# define CONFIG_EXAMPLES_BUTTONS_NAME4 "BUTTON4"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME5
-# define CONFIG_EXAMPLE_BUTTONS_NAME5 "BUTTON5"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME5
+# define CONFIG_EXAMPLES_BUTTONS_NAME5 "BUTTON5"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME6
-# define CONFIG_EXAMPLE_BUTTONS_NAME6 "BUTTON6"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME6
+# define CONFIG_EXAMPLES_BUTTONS_NAME6 "BUTTON6"
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_NAME7
-# define CONFIG_EXAMPLE_BUTTONS_NAME7 "BUTTON7"
+#ifndef CONFIG_EXAMPLES_BUTTONS_NAME7
+# define CONFIG_EXAMPLES_BUTTONS_NAME7 "BUTTON7"
#endif
#define BUTTON_MIN 0
#define BUTTON_MAX 7
-#ifndef CONFIG_EXAMPLE_BUTTONS_MIN
-# define CONFIG_EXAMPLE_BUTTONS_MIN BUTTON_MIN
+#ifndef CONFIG_EXAMPLES_BUTTONS_MIN
+# define CONFIG_EXAMPLES_BUTTONS_MIN BUTTON_MIN
#endif
-#ifndef CONFIG_EXAMPLE_BUTTONS_MAX
-# define CONFIG_EXAMPLE_BUTTONS_MAX BUTTON_MAX
+#ifndef CONFIG_EXAMPLES_BUTTONS_MAX
+# define CONFIG_EXAMPLES_BUTTONS_MAX BUTTON_MAX
#endif
-#if CONFIG_EXAMPLE_BUTTONS_MIN > CONFIG_EXAMPLE_BUTTONS_MAX
-# error "CONFIG_EXAMPLE_BUTTONS_MIN > CONFIG_EXAMPLE_BUTTONS_MAX"
+#if CONFIG_EXAMPLES_BUTTONS_MIN > CONFIG_EXAMPLES_BUTTONS_MAX
+# error "CONFIG_EXAMPLES_BUTTONS_MIN > CONFIG_EXAMPLES_BUTTONS_MAX"
#endif
-#if CONFIG_EXAMPLE_BUTTONS_MAX > 7
-# error "CONFIG_EXAMPLE_BUTTONS_MAX > 7"
+#if CONFIG_EXAMPLES_BUTTONS_MAX > 7
+# error "CONFIG_EXAMPLES_BUTTONS_MAX > 7"
#endif
-#ifndef CONFIG_EXAMPLE_IRQBUTTONS_MIN
-# define CONFIG_EXAMPLE_IRQBUTTONS_MIN CONFIG_EXAMPLE_BUTTONS_MIN
+#ifndef CONFIG_EXAMPLES_IRQBUTTONS_MIN
+# define CONFIG_EXAMPLES_IRQBUTTONS_MIN CONFIG_EXAMPLES_BUTTONS_MIN
#endif
-#ifndef CONFIG_EXAMPLE_IRQBUTTONS_MAX
-# define CONFIG_EXAMPLE_IRQBUTTONS_MAX CONFIG_EXAMPLE_BUTTONS_MAX
+#ifndef CONFIG_EXAMPLES_IRQBUTTONS_MAX
+# define CONFIG_EXAMPLES_IRQBUTTONS_MAX CONFIG_EXAMPLES_BUTTONS_MAX
#endif
-#if CONFIG_EXAMPLE_IRQBUTTONS_MIN > CONFIG_EXAMPLE_IRQBUTTONS_MAX
-# error "CONFIG_EXAMPLE_IRQBUTTONS_MIN > CONFIG_EXAMPLE_IRQBUTTONS_MAX"
+#if CONFIG_EXAMPLES_IRQBUTTONS_MIN > CONFIG_EXAMPLES_IRQBUTTONS_MAX
+# error "CONFIG_EXAMPLES_IRQBUTTONS_MIN > CONFIG_EXAMPLES_IRQBUTTONS_MAX"
#endif
-#if CONFIG_EXAMPLE_IRQBUTTONS_MAX > 7
-# error "CONFIG_EXAMPLE_IRQBUTTONS_MAX > 7"
+#if CONFIG_EXAMPLES_IRQBUTTONS_MAX > 7
+# error "CONFIG_EXAMPLES_IRQBUTTONS_MAX > 7"
#endif
#ifndef MIN
@@ -124,8 +124,8 @@
# define MAX(a,b) (a > b ? a : b)
#endif
-#define MIN_BUTTON MIN(CONFIG_EXAMPLE_BUTTONS_MIN, CONFIG_EXAMPLE_IRQBUTTONS_MIN)
-#define MAX_BUTTON MAX(CONFIG_EXAMPLE_BUTTONS_MAX, CONFIG_EXAMPLE_IRQBUTTONS_MAX)
+#define MIN_BUTTON MIN(CONFIG_EXAMPLES_BUTTONS_MIN, CONFIG_EXAMPLES_IRQBUTTONS_MIN)
+#define MAX_BUTTON MAX(CONFIG_EXAMPLES_BUTTONS_MAX, CONFIG_EXAMPLES_IRQBUTTONS_MAX)
#define NUM_BUTTONS (MAX_BUTTON - MIN_BUTTON + 1)
#define BUTTON_INDEX(b) ((b)-MIN_BUTTON)
@@ -187,7 +187,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
{
#if MIN_BUTTON < 1
{
- CONFIG_EXAMPLE_BUTTONS_NAME0,
+ CONFIG_EXAMPLES_BUTTONS_NAME0,
#ifdef CONFIG_ARCH_IRQBUTTONS
button0_handler
#endif
@@ -195,7 +195,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 2 && MAX_BUTTON > 0
{
- CONFIG_EXAMPLE_BUTTONS_NAME1,
+ CONFIG_EXAMPLES_BUTTONS_NAME1,
#ifdef CONFIG_ARCH_IRQBUTTONS
button1_handler
#endif
@@ -203,7 +203,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 3 && MAX_BUTTON > 1
{
- CONFIG_EXAMPLE_BUTTONS_NAME2,
+ CONFIG_EXAMPLES_BUTTONS_NAME2,
#ifdef CONFIG_ARCH_IRQBUTTONS
button2_handler
#endif
@@ -211,7 +211,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 4 && MAX_BUTTON > 2
{
- CONFIG_EXAMPLE_BUTTONS_NAME3,
+ CONFIG_EXAMPLES_BUTTONS_NAME3,
#ifdef CONFIG_ARCH_IRQBUTTONS
button3_handler
#endif
@@ -219,7 +219,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 5 && MAX_BUTTON > 3
{
- CONFIG_EXAMPLE_BUTTONS_NAME4,
+ CONFIG_EXAMPLES_BUTTONS_NAME4,
#ifdef CONFIG_ARCH_IRQBUTTONS
button4_handler
#endif
@@ -227,7 +227,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 6 && MAX_BUTTON > 4
{
- CONFIG_EXAMPLE_BUTTONS_NAME5,
+ CONFIG_EXAMPLES_BUTTONS_NAME5,
#ifdef CONFIG_ARCH_IRQBUTTONS
button5_handler
#endif
@@ -235,7 +235,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MIN_BUTTON < 7 && MAX_BUTTON > 5
{
- CONFIG_EXAMPLE_BUTTONS_NAME6,
+ CONFIG_EXAMPLES_BUTTONS_NAME6,
#ifdef CONFIG_ARCH_IRQBUTTONS
button6_handler
#endif
@@ -243,7 +243,7 @@ static const struct button_info_s g_buttoninfo[NUM_BUTTONS] =
#endif
#if MAX_BUTTON > 6
{
- CONFIG_EXAMPLE_BUTTONS_NAME7,
+ CONFIG_EXAMPLES_BUTTONS_NAME7,
#ifdef CONFIG_ARCH_IRQBUTTONS
button7_handler
#endif
@@ -419,7 +419,7 @@ int buttons_main(int argc, char *argv[])
/* Register to recieve button interrupts */
#ifdef CONFIG_ARCH_IRQBUTTONS
- for (i = CONFIG_EXAMPLE_IRQBUTTONS_MIN; i <= CONFIG_EXAMPLE_IRQBUTTONS_MAX; i++)
+ for (i = CONFIG_EXAMPLES_IRQBUTTONS_MIN; i <= CONFIG_EXAMPLES_IRQBUTTONS_MAX; i++)
{
xcpt_t oldhandler = up_irqbutton(i, g_buttoninfo[BUTTON_INDEX(i)].handler);
@@ -488,7 +488,7 @@ int buttons_main(int argc, char *argv[])
/* Un-register button handlers */
#if defined(CONFIG_ARCH_IRQBUTTONS) && defined(CONFIG_NSH_BUILTIN_APPS)
- for (i = CONFIG_EXAMPLE_IRQBUTTONS_MIN; i <= CONFIG_EXAMPLE_IRQBUTTONS_MAX; i++)
+ for (i = CONFIG_EXAMPLES_IRQBUTTONS_MIN; i <= CONFIG_EXAMPLES_IRQBUTTONS_MAX; i++)
{
(void)up_irqbutton(i, NULL);
}
diff --git a/apps/examples/poll/net_listener.c b/apps/examples/poll/net_listener.c
index 81ad7cdcc..2be98673c 100644
--- a/apps/examples/poll/net_listener.c
+++ b/apps/examples/poll/net_listener.c
@@ -290,14 +290,14 @@ static inline bool net_mksocket(struct net_listener_s *nls)
static void net_configure(void)
{
struct in_addr addr;
-#if defined(CONFIG_EXAMPLE_POLL_NOMAC)
+#if defined(CONFIG_EXAMPLES_POLL_NOMAC)
uint8_t mac[IFHWADDRLEN];
#endif
/* Configure uIP */
/* Many embedded network interfaces must have a software assigned MAC */
-#ifdef CONFIG_EXAMPLE_POLL_NOMAC
+#ifdef CONFIG_EXAMPLES_POLL_NOMAC
mac[0] = 0x00;
mac[1] = 0xe0;
mac[2] = 0xde;
@@ -309,17 +309,17 @@ static void net_configure(void)
/* Set up our host address */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_IPADDR);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_IPADDR);
uip_sethostaddr("eth0", &addr);
/* Set up the default router address */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_DRIPADDR);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_DRIPADDR);
uip_setdraddr("eth0", &addr);
/* Setup the subnet mask */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_NETMASK);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_NETMASK);
uip_setnetmask("eth0", &addr);
}
diff --git a/apps/examples/poll/net_reader.c b/apps/examples/poll/net_reader.c
index 8a13618c3..2f23bab3c 100644
--- a/apps/examples/poll/net_reader.c
+++ b/apps/examples/poll/net_reader.c
@@ -83,14 +83,14 @@
static void net_configure(void)
{
struct in_addr addr;
-#if defined(CONFIG_EXAMPLE_POLL_NOMAC)
+#if defined(CONFIG_EXAMPLES_POLL_NOMAC)
uint8_t mac[IFHWADDRLEN];
#endif
/* Configure uIP */
/* Many embedded network interfaces must have a software assigned MAC */
-#ifdef CONFIG_EXAMPLE_POLL_NOMAC
+#ifdef CONFIG_EXAMPLES_POLL_NOMAC
mac[0] = 0x00;
mac[1] = 0xe0;
mac[2] = 0xde;
@@ -102,17 +102,17 @@ static void net_configure(void)
/* Set up our host address */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_IPADDR);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_IPADDR);
uip_sethostaddr("eth0", &addr);
/* Set up the default router address */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_DRIPADDR);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_DRIPADDR);
uip_setdraddr("eth0", &addr);
/* Setup the subnet mask */
- addr.s_addr = HTONL(CONFIG_EXAMPLE_POLL_NETMASK);
+ addr.s_addr = HTONL(CONFIG_EXAMPLES_POLL_NETMASK);
uip_setnetmask("eth0", &addr);
}