Fixed bug 2846162.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1110 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2009-08-28 11:54:36 +00:00
parent 8b55cb9767
commit c4299aa2da
1 changed files with 3 additions and 2 deletions

View File

@ -138,18 +138,19 @@ static void wakeup(void *p) {
* @retval RDY_TIMEOUT if a timeout occurs. * @retval RDY_TIMEOUT if a timeout occurs.
*/ */
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
Thread *tp = currp;
if (TIME_INFINITE != time) { if (TIME_INFINITE != time) {
VirtualTimer vt; VirtualTimer vt;
chVTSetI(&vt, time, wakeup, currp); chVTSetI(&vt, time, wakeup, tp);
chSchGoSleepS(newstate); chSchGoSleepS(newstate);
if (chVTIsArmedI(&vt)) if (chVTIsArmedI(&vt))
chVTResetI(&vt); chVTResetI(&vt);
} }
else else
chSchGoSleepS(newstate); chSchGoSleepS(newstate);
return currp->p_rdymsg; return tp->p_rdymsg;
} }
/** /**