From e776216d02920673266e31d553078f4edec4a264 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 13 Nov 2007 16:38:23 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@89 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chschd.c | 2 +- src/chsleep.c | 13 ------------- src/include/scheduler.h | 2 +- src/include/sleep.h | 10 ++++++++++ 4 files changed, 12 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/chschd.c b/src/chschd.c index c30040520..c88a63ead 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -34,7 +34,7 @@ Thread *currp; #endif #ifdef CH_USE_SYSTEMTIME -t_time stime; +volatile t_time stime; #endif /** @endcond */ diff --git a/src/chsleep.c b/src/chsleep.c index 6c8cfc3c3..e8703ab1a 100644 --- a/src/chsleep.c +++ b/src/chsleep.c @@ -41,19 +41,6 @@ void chThdSleep(t_time time) { } #ifdef CH_USE_SYSTEMTIME -/** - * Returns the number of system ticks since the \p chSysInit() invocation. - * @return the system ticks number - * @note The counter can reach its maximum and return to zero. - * @note This function is designed to work with the \p chThdSleepUntil(). - * @note The function is available only if the \p CH_USE_SYSTEMTIME - * option is enabled in \p chconf.h. - */ -t_time chSysGetTime(void) { - - return stime; -} - /** * Suspends the invoking thread until the system time arrives to the specified * value. diff --git a/src/include/scheduler.h b/src/include/scheduler.h index fccbfb446..12393e0db 100644 --- a/src/include/scheduler.h +++ b/src/include/scheduler.h @@ -78,7 +78,7 @@ extern Thread *currp; * instead. Direct use of system global variables is discouraged because * portability reasons. */ -extern t_time stime; +extern volatile t_time stime; #endif /* _SCHEDULER_H_ */ diff --git a/src/include/sleep.h b/src/include/sleep.h index e3fa2ffda..e102a03a5 100644 --- a/src/include/sleep.h +++ b/src/include/sleep.h @@ -39,6 +39,16 @@ extern "C" { } #endif +/** + * Returns the number of system ticks since the \p chSysInit() invocation. + * @return the system ticks number + * @note The counter can reach its maximum and then returns to zero. + * @note This function is designed to work with the \p chThdSleepUntil(). + * @note The function is available only if the \p CH_USE_SYSTEMTIME + * option is enabled in \p chconf.h. + */ +#define chSysGetTime() stime + #endif /* _SLEEP_H_ */ /** @} */ -- cgit v1.2.3