aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-15 13:05:47 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-05-15 13:05:47 +0000
commitb793081d9605192373ea4fc1c1d7d5ca6e46e546 (patch)
tree9bf0a6a7c1ba05e76799093e933b5630b34818d0 /demos/ARM7-AT91SAM7X-LWIP-GCC/lwip
parentc2693bcad09b0fa5e5fbf323d3e23c8ee0a2e1dc (diff)
downloadChibiOS-b793081d9605192373ea4fc1c1d7d5ca6e46e546.tar.gz
ChibiOS-b793081d9605192373ea4fc1c1d7d5ca6e46e546.tar.bz2
ChibiOS-b793081d9605192373ea4fc1c1d7d5ca6e46e546.zip
Fixed bug 3302420.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2964 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-LWIP-GCC/lwip')
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c10
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c2
2 files changed, 7 insertions, 5 deletions
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 d9b619e4d..082f2db4d 100644
--- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c
+++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c
@@ -91,11 +91,12 @@ void sys_sem_signal(sys_sem_t sem) {
}
u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout) {
- systime_t time;
+ 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;
@@ -135,11 +136,12 @@ 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) {
- systime_t time;
+ 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;
diff --git a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
index 7f3b93e59..8b2fd1854 100644
--- a/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
+++ b/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/lwipthread.c
@@ -142,7 +142,7 @@ static struct pbuf *low_level_input(struct netif *netif) {
(void)netif;
if (macWaitReceiveDescriptor(&ETH1, &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 */