aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch
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/arch
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/arch')
-rw-r--r--demos/ARM7-AT91SAM7X-LWIP-GCC/lwip/arch/sys_arch.c10
1 files changed, 6 insertions, 4 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;