diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-13 16:38:23 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-13 16:38:23 +0000 |
commit | e776216d02920673266e31d553078f4edec4a264 (patch) | |
tree | 3234cf9898f59dec30092da35cc4f1dd76f77b03 /src | |
parent | 95618293b7e096240966c715eb9f5f2f420f9588 (diff) | |
download | ChibiOS-e776216d02920673266e31d553078f4edec4a264.tar.gz ChibiOS-e776216d02920673266e31d553078f4edec4a264.tar.bz2 ChibiOS-e776216d02920673266e31d553078f4edec4a264.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@89 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r-- | src/chschd.c | 2 | ||||
-rw-r--r-- | src/chsleep.c | 13 | ||||
-rw-r--r-- | src/include/scheduler.h | 2 | ||||
-rw-r--r-- | src/include/sleep.h | 10 |
4 files changed, 12 insertions, 15 deletions
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 @@ -42,19 +42,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.
* @param time the system time
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_ */
/** @} */
|