diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-23 14:50:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-23 14:50:42 +0000 |
commit | 68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 (patch) | |
tree | 719bb767775d1cddb05f070b32b67abfa51a37e9 /src/chevents.c | |
parent | 1aecb14913213565c804dda42322c6fb3136827d (diff) | |
download | ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.tar.gz ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.tar.bz2 ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@182 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chevents.c')
-rw-r--r-- | src/chevents.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/chevents.c b/src/chevents.c index 13a858acd..72ca7c182 100644 --- a/src/chevents.c +++ b/src/chevents.c @@ -142,12 +142,6 @@ t_eventid chEvtWait(t_eventmask ewmask, return chEvtWaitTimeout(ewmask, handlers, TIME_INFINITE);
}
-static void wakeup(void *p) {
-
- chDbgAssert(((Thread *)p)->p_state == PRWTEVENT, "chevents.c, wakeup()");
- chSchReadyI(p, RDY_TIMEOUT);
-}
-
/**
* The function waits for an event or the specified timeout then returns the
* event identifier, if an event handler is specified then the handler is
@@ -177,17 +171,9 @@ t_eventid chEvtWaitTimeout(t_eventmask ewmask, chSysLock();
if ((currp->p_epending & ewmask) == 0) {
- VirtualTimer vt;
-
- chVTSetI(&vt, time, wakeup, currp);
currp->p_ewmask = ewmask;
- chSchGoSleepS(PRWTEVENT);
- if (!chVTIsArmedI(&vt)) {
-
- chSysUnlock();
+ if (chSchGoSleepTimeoutS(PRWTEVENT, time) < RDY_OK)
return RDY_TIMEOUT;
- }
- chVTResetI(&vt);
}
i = 0, m = 1;
while ((currp->p_epending & ewmask & m) == 0)
|