diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-26 16:28:30 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-02-26 16:28:30 +0000 |
commit | d681635b85e4a498dafd8822af19e0d5cd7f8f2f (patch) | |
tree | 1a01cc6fb1877f89a28b64b2d1576a1cd38fbffd /apps/examples/thttpd | |
parent | 8fd4abf5ec0512bcdc43a3909bb3d691aa328e53 (diff) | |
download | px4-nuttx-d681635b85e4a498dafd8822af19e0d5cd7f8f2f.tar.gz px4-nuttx-d681635b85e4a498dafd8822af19e0d5cd7f8f2f.tar.bz2 px4-nuttx-d681635b85e4a498dafd8822af19e0d5cd7f8f2f.zip |
Add a THTTPD configuratin for zkit-arm-1769
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5675 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/examples/thttpd')
-rw-r--r-- | apps/examples/thttpd/Kconfig | 16 | ||||
-rw-r--r-- | apps/examples/thttpd/content/tasks/tasks.c | 49 |
2 files changed, 52 insertions, 13 deletions
diff --git a/apps/examples/thttpd/Kconfig b/apps/examples/thttpd/Kconfig index d5802f531..42ec1381f 100644 --- a/apps/examples/thttpd/Kconfig +++ b/apps/examples/thttpd/Kconfig @@ -10,4 +10,20 @@ config EXAMPLES_THTTPD Enable the THTTPD web server example if EXAMPLES_THTTPD + +config EXAMPLES_THTTPD_NOMAC + bool "Use Canned MAC Address" + default n + ---help--- + May be defined to use a hard-coded, software assigned MAC of + 00:0e:de:ad:be:ef + +config EXAMPLES_THTTPD_DRIPADDR + hex "Default Router IP address (Gateway)" + default 0x0a000001 + +config EXAMPLES_THTTPD_NETMASK + hex "Network Mask" + default 0xffffff00 + endif diff --git a/apps/examples/thttpd/content/tasks/tasks.c b/apps/examples/thttpd/content/tasks/tasks.c index 131cbd60f..393ef5a23 100644 --- a/apps/examples/thttpd/content/tasks/tasks.c +++ b/apps/examples/thttpd/content/tasks/tasks.c @@ -107,7 +107,7 @@ static const char *g_ttypenames[4] = { int i; - /* Show task status */ + /* Show task/thread status */ printf("%5d %3d %4s %7s%c%c %8s ", tcb->pid, tcb->sched_priority, @@ -117,26 +117,49 @@ static const char *g_ttypenames[4] = tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : ' ', g_statenames[tcb->task_state]); - /* Show task name and arguments */ + /* Is this a task or a thread? */ - printf("%s(", tcb->argv[0]); +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) + { + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; - /* Special case 1st argument (no comma) */ + /* It is a pthread. Show any name assigned to the pthread via prtcl() along + * with the startup value. + */ - if (tcb->argv[1]) - { - printf("%p", tcb->argv[1]); +#if CONFIG_TASK_NAME_SIZE > 0 + printf("%s(%p)\n", tcb->name, ptcb->arg); +#else + printf("pthread(%p)\n", ptcb->arg); +#endif } + else +#endif + { + FAR struct task_tcb_s *ttcb = (FAR struct task_tcb_s *)tcb; + + /* Show task name and arguments */ - /* Then any additional arguments */ + printf("%s(", ttcb->argv[0]); + + /* Special case 1st argument (no comma) */ + + if (ttcb->argv[1]) + { + printf("%p", ttcb->argv[1]); + } + + /* Then any additional arguments */ #if CONFIG_MAX_TASK_ARGS > 2 - for (i = 2; i <= CONFIG_MAX_TASK_ARGS && tcb->argv[i]; i++) - { - printf(", %p", tcb->argv[i]); - } + for (i = 2; i <= CONFIG_MAX_TASK_ARGS && ttcb->argv[i]; i++) + { + printf(", %p", ttcb->argv[i]); + } #endif - printf(")\n"); + printf(")\n"); + } } /**************************************************************************** |