mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 16:13:34 +08:00
Change all occurrences of CONFIG_EXAMPLE_ to CONFIG_EXAMPLES_ for consistency; fleshed out a few more Kconfig files
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5211 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -43,7 +43,7 @@ TARG_ASRCS =
|
||||
TARG_AOBJS = $(TARG_ASRCS:.S=$(OBJEXT))
|
||||
|
||||
TARG_CSRCS = nettest.c
|
||||
ifeq ($(CONFIG_EXAMPLE_NETTEST_SERVER),y)
|
||||
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
|
||||
TARG_CSRCS += nettest_server.c
|
||||
else
|
||||
TARG_CSRCS += nettest_client.c
|
||||
@@ -61,19 +61,19 @@ else
|
||||
TARG_BIN = "$(TARG_POSIX)"
|
||||
endif
|
||||
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLE_NETTEST_HOST=1
|
||||
ifeq ($(CONFIG_EXAMPLE_NETTEST_SERVER),y)
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLE_NETTEST_SERVER=1 \
|
||||
-DCONFIG_EXAMPLE_NETTEST_CLIENTIP="$(CONFIG_EXAMPLE_NETTEST_CLIENTIP)"
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_HOST=1
|
||||
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_SERVER=1 \
|
||||
-DCONFIG_EXAMPLES_NETTEST_CLIENTIP="$(CONFIG_EXAMPLES_NETTEST_CLIENTIP)"
|
||||
endif
|
||||
ifeq ($(CONFIG_EXAMPLE_NETTEST_PERFORMANCE),y)
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLE_NETTEST_PERFORMANCE=1
|
||||
ifeq ($(CONFIG_EXAMPLES_NETTEST_PERFORMANCE),y)
|
||||
HOSTCFLAGS += -DCONFIG_EXAMPLES_NETTEST_PERFORMANCE=1
|
||||
endif
|
||||
|
||||
|
||||
|
||||
HOST_SRCS = host.c
|
||||
ifeq ($(CONFIG_EXAMPLE_NETTEST_SERVER),y)
|
||||
ifeq ($(CONFIG_EXAMPLES_NETTEST_SERVER),y)
|
||||
HOST_SRCS += nettest_client.c
|
||||
else
|
||||
HOST_SRCS += nettest_server.c
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
int main(int argc, char **argv, char **envp)
|
||||
{
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_SERVER
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_SERVER
|
||||
send_client();
|
||||
#else
|
||||
recv_server();
|
||||
|
||||
@@ -68,13 +68,13 @@
|
||||
int nettest_main(int argc, char *argv[])
|
||||
{
|
||||
struct in_addr addr;
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_NOMAC
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_NOMAC
|
||||
uint8_t mac[IFHWADDRLEN];
|
||||
#endif
|
||||
|
||||
/* Many embedded network interfaces must have a software assigned MAC */
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_NOMAC
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_NOMAC
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xe0;
|
||||
mac[2] = 0xde;
|
||||
@@ -86,20 +86,20 @@ int nettest_main(int argc, char *argv[])
|
||||
|
||||
/* Set up our host address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_IPADDR);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_IPADDR);
|
||||
uip_sethostaddr("eth0", &addr);
|
||||
|
||||
/* Set up the default router address */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_DRIPADDR);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_DRIPADDR);
|
||||
uip_setdraddr("eth0", &addr);
|
||||
|
||||
/* Setup the subnet mask */
|
||||
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_NETMASK);
|
||||
addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_NETMASK);
|
||||
uip_setnetmask("eth0", &addr);
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_SERVER
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_SERVER
|
||||
recv_server();
|
||||
#else
|
||||
send_client();
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_HOST
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_HOST
|
||||
#else
|
||||
# include <debug.h>
|
||||
#endif
|
||||
@@ -49,7 +49,7 @@
|
||||
* Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_HOST
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_HOST
|
||||
/* HTONS/L macros are unique to uIP */
|
||||
|
||||
# define HTONS(a) htons(a)
|
||||
|
||||
@@ -56,12 +56,12 @@ void send_client(void)
|
||||
{
|
||||
struct sockaddr_in myaddr;
|
||||
char *outbuf;
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
char *inbuf;
|
||||
#endif
|
||||
int sockfd;
|
||||
int nbytessent;
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
int nbytesrecvd;
|
||||
int totalbytesrecvd;
|
||||
#endif
|
||||
@@ -71,7 +71,7 @@ void send_client(void)
|
||||
/* Allocate buffers */
|
||||
|
||||
outbuf = (char*)malloc(SENDSIZE);
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
inbuf = (char*)malloc(SENDSIZE);
|
||||
if (!outbuf || !inbuf)
|
||||
#else
|
||||
@@ -98,7 +98,7 @@ void send_client(void)
|
||||
#if 0
|
||||
myaddr.sin_addr.s_addr = HTONL(INADDR_LOOPBACK);
|
||||
#else
|
||||
myaddr.sin_addr.s_addr = HTONL(CONFIG_EXAMPLE_NETTEST_CLIENTIP);
|
||||
myaddr.sin_addr.s_addr = HTONL(CONFIG_EXAMPLES_NETTEST_CLIENTIP);
|
||||
#endif
|
||||
|
||||
message("client: Connecting...\n");
|
||||
@@ -121,7 +121,7 @@ void send_client(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
/* Then send messages forever */
|
||||
|
||||
for (;;)
|
||||
@@ -192,7 +192,7 @@ void send_client(void)
|
||||
|
||||
close(sockfd);
|
||||
free(outbuf);
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
free(inbuf);
|
||||
#endif
|
||||
return;
|
||||
@@ -203,7 +203,7 @@ errout_with_socket:
|
||||
|
||||
errout_with_buffers:
|
||||
free(outbuf);
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
free(inbuf);
|
||||
#endif
|
||||
exit(1);
|
||||
|
||||
@@ -63,7 +63,7 @@ void recv_server(void)
|
||||
int acceptsd;
|
||||
socklen_t addrlen;
|
||||
int nbytesread;
|
||||
#ifndef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifndef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
int totalbytesread;
|
||||
int nbytessent;
|
||||
int ch;
|
||||
@@ -143,7 +143,7 @@ void recv_server(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_EXAMPLE_NETTEST_PERFORMANCE
|
||||
#ifdef CONFIG_EXAMPLES_NETTEST_PERFORMANCE
|
||||
/* Then receive data forever */
|
||||
|
||||
for (;;)
|
||||
|
||||
Reference in New Issue
Block a user