diff options
Diffstat (limited to 'demos/ARM7-AT91SAM7X-LWIP-GCC')
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile | 2 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld | 3 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h | 50 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h | 68 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h | 12 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h | 3 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c | 97 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h | 28 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk | 71 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c | 5 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h | 3 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/main.c | 3 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h | 3 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c | 13 | ||||
-rw-r--r-- | demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h | 3 |
15 files changed, 231 insertions, 133 deletions
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile index 4caf96ebf..b181251e7 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/Makefile @@ -150,7 +150,7 @@ CPPWARN = -Wall -Wextra #
# List all default C defines here, like -D_DEBUG=1
-DDEFS = -DLWIP_PROVIDE_ERRNO
+DDEFS =
# List all default ASM defines here, like -D_DEBUG=1
DADEFS =
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld b/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld index 67fe8d223..9308935be 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/ch.ld @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h index a7ff720a7..202dfc511 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/chconf.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -83,12 +84,29 @@ *
* @note In order to let the OS manage the whole RAM the linker script must
* provide the @p __heap_base__ and @p __heap_end__ symbols.
- * @note Requires @p CH_USE_COREMEM.
+ * @note Requires @p CH_USE_MEMCORE.
*/
#if !defined(CH_MEMCORE_SIZE) || defined(__DOXYGEN__)
#define CH_MEMCORE_SIZE 0
#endif
+/**
+ * @brief Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ * does not spawn the idle thread automatically. The application has
+ * then the responsibility to do one of the following:
+ * - Spawn a custom idle thread at priority @p IDLEPRIO.
+ * - Change the main() thread priority to @p IDLEPRIO then enter
+ * an endless loop. In this scenario the @p main() thread acts as
+ * the idle thread.
+ * .
+ * @note Unless an idle thread is spawned the @p main() thread must not
+ * enter a sleep state.
+ */
+#if !defined(CH_NO_IDLE_THREAD) || defined(__DOXYGEN__)
+#define CH_NO_IDLE_THREAD FALSE
+#endif
+
/*===========================================================================*/
/* Performance options. */
/*===========================================================================*/
@@ -105,26 +123,6 @@ #define CH_OPTIMIZE_SPEED TRUE
#endif
-/**
- * @brief Exotic optimization.
- * @details If defined then a CPU register is used as storage for the global
- * @p currp variable. Caching this variable in a register greatly
- * improves both space and time OS efficiency. A side effect is that
- * one less register has to be saved during the context switch
- * resulting in lower RAM usage and faster context switch.
- *
- * @note This option is only usable with the GCC compiler and is only useful
- * on processors with many registers like ARM cores.
- * @note If this option is enabled then ALL the libraries linked to the
- * ChibiOS/RT code <b>must</b> be recompiled with the GCC option @p
- * -ffixed-@<reg@>.
- * @note This option must be enabled in the Makefile, it is listed here for
- * documentation only.
- */
-#if defined(__DOXYGEN__)
-#define CH_CURRP_REGISTER_CACHE "reg"
-#endif
-
/*===========================================================================*/
/* Subsystem options. */
/*===========================================================================*/
@@ -280,7 +278,6 @@ * @details If enabled then the I/O queues APIs are included in the kernel.
*
* @note The default is @p TRUE.
- * @note Requires @p CH_USE_SEMAPHORES.
*/
#if !defined(CH_USE_QUEUES) || defined(__DOXYGEN__)
#define CH_USE_QUEUES TRUE
@@ -303,7 +300,7 @@ * in the kernel.
*
* @note The default is @p TRUE.
- * @note Requires @p CH_USE_COREMEM and either @p CH_USE_MUTEXES or
+ * @note Requires @p CH_USE_MEMCORE and either @p CH_USE_MUTEXES or
* @p CH_USE_SEMAPHORES.
* @note Mutexes are recommended.
*/
@@ -318,7 +315,7 @@ *
* @note The default is @p FALSE.
* @note Requires @p CH_USE_HEAP.
- * @note The C-runtime may or may not require @p CH_USE_COREMEM, see the
+ * @note The C-runtime may or may not require @p CH_USE_MEMCORE, see the
* appropriate documentation.
*/
#if !defined(CH_USE_MALLOC_HEAP) || defined(__DOXYGEN__)
@@ -438,8 +435,6 @@ #define THREAD_EXT_FIELDS \
struct { \
/* Add threads custom fields here.*/ \
- /* Space for the LWIP sys_timeouts structure.*/ \
- void *p_lwipspace[1]; \
};
#endif
@@ -453,7 +448,6 @@ struct { \ #if !defined(THREAD_EXT_INIT_HOOK) || defined(__DOXYGEN__)
#define THREAD_EXT_INIT_HOOK(tp) { \
/* Add threads initialization code here.*/ \
- (tp)->p_lwipspace[0] = NULL; \
}
#endif
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h index 268525a61..d3124c4d3 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/halconf.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -55,6 +56,13 @@ #endif
/**
+ * @brief Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT FALSE
+#endif
+
+/**
* @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
@@ -62,6 +70,13 @@ #endif
/**
+ * @brief Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU FALSE
+#endif
+
+/**
* @brief Enables the MAC subsystem.
*/
#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
@@ -83,6 +98,13 @@ #endif
/**
+ * @brief Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC FALSE
+#endif
+
+/**
* @brief Enables the SERIAL subsystem.
*/
#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
@@ -90,6 +112,13 @@ #endif
/**
+ * @brief Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB FALSE
+#endif
+
+/**
* @brief Enables the SPI subsystem.
*/
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
@@ -103,6 +132,13 @@ #define HAL_USE_UART FALSE
#endif
+/**
+ * @brief Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB FALSE
+#endif
+
/*===========================================================================*/
/* ADC driver related settings. */
/*===========================================================================*/
@@ -207,6 +243,36 @@ /*===========================================================================*/
/*===========================================================================*/
+/* SDC driver related settings. */
+/*===========================================================================*/
+/**
+ * @brief Number of initialization attempts before rejecting the card.
+ * @note Attempts are performed at 10mS intevals.
+ */
+#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
+#define SDC_INIT_RETRY 100
+#endif
+
+/**
+ * @brief Include support for MMC cards.
+ * @note MMC support is not yet implemented so this option must be kept
+ * at @p FALSE.
+ */
+#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
+#define SDC_MMC_SUPPORT FALSE
+#endif
+
+/**
+ * @brief Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ * routines releasing some extra CPU time for the threads with
+ * lower priority, this may slow down the driver a bit however.
+ */
+#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
+#define SDC_NICE_WAITING TRUE
+#endif
+
+/*===========================================================================*/
/* SERIAL driver related settings. */
/*===========================================================================*/
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h index 62d037e80..ecac81e09 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/cc.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -70,5 +71,14 @@ typedef uint32_t mem_ptr_t; }
#define BYTE_ORDER LITTLE_ENDIAN
+#define LWIP_PROVIDE_ERRNO
+
+#define PACK_STRUCT_BEGIN
+#ifdef PACK_STRUCT_STRUCT
+#undef PACK_STRUCT_STRUCT
+#endif
+#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
+#define PACK_STRUCT_END
+#define PACK_STRUCT_FIELD(x) x
#endif /* __CC_H__ */
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h index 99b4a7197..f30c8781c 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/perf.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c index 517bfba03..7e0212df7 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -51,6 +52,8 @@ *
*/
+// see http://lwip.wikia.com/wiki/Porting_for_an_OS for instructions
+
#include "ch.h"
#include "lwip/opt.h"
@@ -65,36 +68,39 @@ void sys_init(void) { }
-sys_sem_t sys_sem_new(u8_t count) {
+err_t sys_sem_new(sys_sem_t *sem, u8_t count) {
- sys_sem_t sem = chHeapAlloc(NULL, sizeof(Semaphore));
- if (sem == 0) {
+ *sem = chHeapAlloc(NULL, sizeof(Semaphore));
+ if (*sem == 0) {
SYS_STATS_INC(sem.err);
+ return ERR_MEM;
}
else {
- chSemInit(sem, (cnt_t)count);
+ chSemInit(*sem, (cnt_t)count);
SYS_STATS_INC(sem.used);
+ return ERR_OK;
}
- return sem;
}
-void sys_sem_free(sys_sem_t sem) {
+void sys_sem_free(sys_sem_t *sem) {
- chHeapFree(sem);
+ chHeapFree(*sem);
+ *sem = SYS_SEM_NULL;
SYS_STATS_DEC(sem.used);
}
-void sys_sem_signal(sys_sem_t sem) {
+void sys_sem_signal(sys_sem_t *sem) {
- chSemSignal(sem);
+ chSemSignal(*sem);
}
-u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) {
- systime_t time;
+u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) {
+ systime_t time, tmo;
chSysLock();
+ tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE;
time = chTimeNow();
- if (chSemWaitTimeoutS(sem, (systime_t)timeout) != RDY_OK)
+ if (chSemWaitTimeoutS(*sem, tmo) != RDY_OK)
time = SYS_ARCH_TIMEOUT;
else
time = chTimeNow() - time;
@@ -102,43 +108,65 @@ u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) { return time;
}
-sys_mbox_t sys_mbox_new(int size) {
+int sys_sem_valid(sys_sem_t *sem) {
+ return *sem != SYS_SEM_NULL;
+}
+
+// typically called within lwIP after freeing a semaphore
+// to make sure the pointer is not left pointing to invalid data
+void sys_sem_set_invalid(sys_sem_t *sem) {
+ *sem = SYS_SEM_NULL;
+}
+
+err_t sys_mbox_new(sys_mbox_t *mbox, int size) {
- sys_mbox_t mbox = chHeapAlloc(NULL, sizeof(Mailbox) + sizeof(msg_t) * size);
- if (mbox == 0) {
+ *mbox = chHeapAlloc(NULL, sizeof(Mailbox) + sizeof(msg_t) * size);
+ if (*mbox == 0) {
SYS_STATS_INC(mbox.err);
+ return ERR_MEM;
}
else {
- chMBInit(mbox, (void *)(((uint8_t *)mbox) + sizeof(Mailbox)), size);
+ chMBInit(*mbox, (void *)(((uint8_t *)*mbox) + sizeof(Mailbox)), size);
SYS_STATS_INC(mbox.used);
+ return ERR_OK;
}
- return mbox;
}
-void sys_mbox_free(sys_mbox_t mbox) {
+void sys_mbox_free(sys_mbox_t *mbox) {
- chHeapFree(mbox);
+ if (chMBGetUsedCountI(*mbox) != 0) {
+ // If there are messages still present in the mailbox when the mailbox
+ // is deallocated, it is an indication of a programming error in lwIP
+ // and the developer should be notified.
+ SYS_STATS_INC(mbox.err);
+ chMBReset(*mbox);
+ }
+ chHeapFree(*mbox);
+ *mbox = SYS_MBOX_NULL;
SYS_STATS_DEC(mbox.used);
}
-void sys_mbox_post(sys_mbox_t mbox, void *msg) {
+void sys_mbox_post(sys_mbox_t *mbox, void *msg) {
- chMBPost(mbox, (msg_t)msg, TIME_INFINITE);
+ chMBPost(*mbox, (msg_t)msg, TIME_INFINITE);
}
-err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg) {
+err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg) {
- if (chMBPost(mbox, (msg_t)msg, TIME_IMMEDIATE) == RDY_TIMEOUT)
+ if (chMBPost(*mbox, (msg_t)msg, TIME_IMMEDIATE) == RDY_TIMEOUT) {
+ SYS_STATS_INC(mbox.err);
return ERR_MEM;
+ }
return ERR_OK;
}
-u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) {
- systime_t time;
+u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout) {
+ systime_t time, tmo;
chSysLock();
+ tmo = timeout > 0 ? (systime_t)timeout : TIME_INFINITE;
time = chTimeNow();
- if (chMBFetchS(mbox, (msg_t *)msg, (systime_t)timeout) != RDY_OK)
+ if (chMBFetchS(*mbox, (msg_t *)msg, tmo) != RDY_OK)
time = SYS_ARCH_TIMEOUT;
else
time = chTimeNow() - time;
@@ -146,19 +174,24 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout) { return time;
}
-u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg) {
+u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg) {
- if (chMBFetch(mbox, (msg_t *)msg, TIME_IMMEDIATE) == RDY_TIMEOUT)
+ if (chMBFetch(*mbox, (msg_t *)msg, TIME_IMMEDIATE) == RDY_TIMEOUT)
return SYS_MBOX_EMPTY;
return 0;
}
-struct sys_timeouts *sys_arch_timeouts(void) {
+int sys_mbox_valid(sys_mbox_t *mbox) {
+ return *mbox != SYS_MBOX_NULL;
+}
- return (struct sys_timeouts *)currp->p_lwipspace;
+// typically called within lwIP after freeing an mbox
+// to make sure the pointer is not left pointing to invalid data
+void sys_mbox_set_invalid(sys_mbox_t *mbox) {
+ *mbox = SYS_MBOX_NULL;
}
-sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg),
+sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread,
void *arg, int stacksize, int prio) {
(void)name;
size_t wsz = THD_WA_SIZE(stacksize);
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h index f52b9d08b..5c287b243 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -65,28 +66,7 @@ typedef int sys_prot_t; #define SYS_THREAD_NULL (Thread *)0
#define SYS_SEM_NULL (Semaphore *)0
-void sys_init(void);
-sys_sem_t sys_sem_new(u8_t count);
-void sys_sem_free(sys_sem_t sem);
-void sys_sem_signal(sys_sem_t sem);
-u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout);
-
-sys_mbox_t sys_mbox_new(int size);
-void sys_mbox_free(sys_mbox_t mbox);
-void sys_mbox_post(sys_mbox_t mbox, void *msg);
-err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg);
-u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout);
-u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg);
-
-struct sys_timeouts *sys_arch_timeouts(void);
-
-sys_thread_t sys_thread_new(char *name,
- void (* thread)(void *arg),
- void *arg,
- int stacksize,
- int prio);
-
-sys_prot_t sys_arch_protect(void);
-void sys_arch_unprotect(sys_prot_t pval);
+/* let sys.h use binary semaphores for mutexes */
+#define LWIP_COMPAT_MUTEX 1
#endif /* __SYS_ARCH_H__ */
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk index 99a046b9d..55a9bf7f4 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwip.mk @@ -1,44 +1,47 @@ # List of the required lwIP files.
+LWIP = ${CHIBIOS}/ext/lwip-1.4.0
+
LWNETIFSRC = \
- ${CHIBIOS}/ext/lwip/src/netif/etharp.c \
- ${CHIBIOS}/ext/lwip/src/netif/loopif.c
+ ${LWIP}/src/netif/etharp.c
LWCORESRC = \
- ${CHIBIOS}/ext/lwip/src/core/dhcp.c \
- ${CHIBIOS}/ext/lwip/src/core/dns.c \
- ${CHIBIOS}/ext/lwip/src/core/init.c \
- ${CHIBIOS}/ext/lwip/src/core/mem.c \
- ${CHIBIOS}/ext/lwip/src/core/memp.c \
- ${CHIBIOS}/ext/lwip/src/core/netif.c \
- ${CHIBIOS}/ext/lwip/src/core/pbuf.c \
- ${CHIBIOS}/ext/lwip/src/core/raw.c \
- ${CHIBIOS}/ext/lwip/src/core/stats.c \
- ${CHIBIOS}/ext/lwip/src/core/sys.c \
- ${CHIBIOS}/ext/lwip/src/core/tcp.c \
- ${CHIBIOS}/ext/lwip/src/core/tcp_in.c \
- ${CHIBIOS}/ext/lwip/src/core/tcp_out.c \
- ${CHIBIOS}/ext/lwip/src/core/udp.c
+ ${LWIP}/src/core/dhcp.c \
+ ${LWIP}/src/core/dns.c \
+ ${LWIP}/src/core/init.c \
+ ${LWIP}/src/core/mem.c \
+ ${LWIP}/src/core/memp.c \
+ ${LWIP}/src/core/netif.c \
+ ${LWIP}/src/core/pbuf.c \
+ ${LWIP}/src/core/raw.c \
+ ${LWIP}/src/core/stats.c \
+ ${LWIP}/src/core/sys.c \
+ ${LWIP}/src/core/tcp.c \
+ ${LWIP}/src/core/tcp_in.c \
+ ${LWIP}/src/core/tcp_out.c \
+ ${LWIP}/src/core/udp.c
LWIPV4SRC = \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/autoip.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/icmp.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/igmp.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/inet.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/inet_chksum.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/ip.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/ip_addr.c \
- ${CHIBIOS}/ext/lwip/src/core/ipv4/ip_frag.c
+ ${LWIP}/src/core/ipv4/autoip.c \
+ ${LWIP}/src/core/ipv4/icmp.c \
+ ${LWIP}/src/core/ipv4/igmp.c \
+ ${LWIP}/src/core/ipv4/inet.c \
+ ${LWIP}/src/core/ipv4/inet_chksum.c \
+ ${LWIP}/src/core/ipv4/ip.c \
+ ${LWIP}/src/core/ipv4/ip_addr.c \
+ ${LWIP}/src/core/ipv4/ip_frag.c \
+ ${LWIP}/src/core/def.c \
+ ${LWIP}/src/core/timers.c
LWAPISRC = \
- ${CHIBIOS}/ext/lwip/src/api/api_lib.c \
- ${CHIBIOS}/ext/lwip/src/api/api_msg.c \
- ${CHIBIOS}/ext/lwip/src/api/err.c \
- ${CHIBIOS}/ext/lwip/src/api/netbuf.c \
- ${CHIBIOS}/ext/lwip/src/api/netdb.c \
- ${CHIBIOS}/ext/lwip/src/api/netifapi.c \
- ${CHIBIOS}/ext/lwip/src/api/sockets.c \
- ${CHIBIOS}/ext/lwip/src/api/tcpip.c
+ ${LWIP}/src/api/api_lib.c \
+ ${LWIP}/src/api/api_msg.c \
+ ${LWIP}/src/api/err.c \
+ ${LWIP}/src/api/netbuf.c \
+ ${LWIP}/src/api/netdb.c \
+ ${LWIP}/src/api/netifapi.c \
+ ${LWIP}/src/api/sockets.c \
+ ${LWIP}/src/api/tcpip.c
LWINC = \
- ${CHIBIOS}/ext/lwip/src/include \
- ${CHIBIOS}/ext/lwip/src/include/ipv4
+ ${LWIP}/src/include \
+ ${LWIP}/src/include/ipv4
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c index 3c58e266a..8b2fd1854 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -141,7 +142,7 @@ static struct pbuf *low_level_input(struct netif *netif) { (void)netif;
if (macWaitReceiveDescriptor(Ð1, &rd, TIME_IMMEDIATE) == RDY_OK) {
- len = (u16_t)rd.rd_size;
+ len = (u16_t)rd.size;
#if ETH_PAD_SIZE
len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h index 0fe5d9473..c27942a63 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c index d8ff64965..77bebd3fc 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/main.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h index 519405ff1..ed715068b 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/mcuconf.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c index 1bea06de4..3430fc5b6 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -46,12 +47,13 @@ static void http_server_serve(struct netconn *conn) { struct netbuf *inbuf;
char *buf;
u16_t buflen;
+ err_t err;
/* Read the data from the port, blocking if nothing yet there.
We assume the request (the part we care about) is in one netbuf */
- inbuf = netconn_recv(conn);
+ err = netconn_recv(conn, &inbuf);
- if (netconn_err(conn) == ERR_OK) {
+ if (err == ERR_OK) {
netbuf_data(inbuf, (void **)&buf, &buflen);
/* Is this an HTTP GET command? (only check the first 5 chars, since
@@ -91,6 +93,7 @@ WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE); */
msg_t http_server(void *p) {
struct netconn *conn, *newconn;
+ err_t err;
(void)p;
@@ -108,7 +111,9 @@ msg_t http_server(void *p) { chThdSetPriority(WEB_THREAD_PRIORITY);
while(1) {
- newconn = netconn_accept(conn);
+ err = netconn_accept(conn, &newconn);
+ if (err != ERR_OK)
+ continue;
http_server_serve(newconn);
netconn_delete(newconn);
}
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h index 991ce117c..3530c995a 100644 --- a/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h +++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/web/web.h @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
|