aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-13 16:38:23 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-11-13 16:38:23 +0000
commite776216d02920673266e31d553078f4edec4a264 (patch)
tree3234cf9898f59dec30092da35cc4f1dd76f77b03 /src
parent95618293b7e096240966c715eb9f5f2f420f9588 (diff)
downloadChibiOS-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.c2
-rw-r--r--src/chsleep.c13
-rw-r--r--src/include/scheduler.h2
-rw-r--r--src/include/sleep.h10
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_ */
/** @} */