Fixed bug 2846162.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1110 35acf78f-673a-0410-8e92-d51de3d6d3f4master
parent
8b55cb9767
commit
c4299aa2da
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue