From 68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Jan 2008 14:50:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@182 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chsleep.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'src/chsleep.c') diff --git a/src/chsleep.c b/src/chsleep.c index b6c31e1a4..9dad520c7 100644 --- a/src/chsleep.c +++ b/src/chsleep.c @@ -25,47 +25,18 @@ #include #ifdef CH_USE_SLEEP -static void wakeup(void *p) { - - chDbgAssert(((Thread *)p)->p_state == PRSLEEP, "chsleep.c, wakeup()"); - chSchReadyI(p, RDY_OK); -} - /** * Suspends the invoking thread for the specified time. * @param time the system ticks number */ void chThdSleep(t_time time) { - VirtualTimer vt; chSysLock(); - chVTSetI(&vt, time, wakeup, currp); - chSchGoSleepS(PRSLEEP); + chSchGoSleepTimeoutS(PRSLEEP, time); chSysUnlock(); } - -#ifdef CH_USE_SYSTEMTIME -/** - * Suspends the invoking thread until the system time arrives to the specified - * value. - * @param time the system time - * @note The function is available only if the \p CH_USE_SYSTEMTIME - * option is enabled in \p chconf.h. - */ -void chThdSleepUntil(t_time time) { - VirtualTimer vt; - - chSysLock(); - - chVTSetI(&vt, (t_time)(time - rlist.r_stime), wakeup, currp); - chSchGoSleepS(PRSLEEP); - - chSysUnlock(); -} -#endif /* CH_USE_SYSTEMTIME */ - #endif /* CH_USE_SLEEP */ /** @} */ -- cgit v1.2.3