aboutsummaryrefslogtreecommitdiffstats
path: root/src/chsleep.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-01-23 14:50:42 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-01-23 14:50:42 +0000
commit68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 (patch)
tree719bb767775d1cddb05f070b32b67abfa51a37e9 /src/chsleep.c
parent1aecb14913213565c804dda42322c6fb3136827d (diff)
downloadChibiOS-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/chsleep.c')
-rw-r--r--src/chsleep.c31
1 files changed, 1 insertions, 30 deletions
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 <ch.h>
#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 */
/** @} */