aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/ports/ARMCMx/chcore_timer.h
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 08:48:20 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-09-03 08:48:20 +0000
commit9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a (patch)
tree86acab83e6b86703239954be6d8240cf49accb8b /os/rt/ports/ARMCMx/chcore_timer.h
parent156a195bf72bd366f91e03c170ad4b344797778a (diff)
downloadChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.tar.gz
ChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.tar.bz2
ChibiOS-9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6250 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/ports/ARMCMx/chcore_timer.h')
-rw-r--r--os/rt/ports/ARMCMx/chcore_timer.h62
1 files changed, 27 insertions, 35 deletions
diff --git a/os/rt/ports/ARMCMx/chcore_timer.h b/os/rt/ports/ARMCMx/chcore_timer.h
index da3bd82de..1a0f98ac0 100644
--- a/os/rt/ports/ARMCMx/chcore_timer.h
+++ b/os/rt/ports/ARMCMx/chcore_timer.h
@@ -60,26 +60,6 @@
/* Module macros. */
/*===========================================================================*/
-/*===========================================================================*/
-/* External declarations. */
-/*===========================================================================*/
-
-/*===========================================================================*/
-/* Module inline functions. */
-/*===========================================================================*/
-
-/**
- * @brief Returns the system time.
- *
- * @return The system time.
- *
- * @notapi
- */
-static inline systime_t port_timer_get_time(void) {
-
- return stGetCounter();
-}
-
/**
* @brief Starts the alarm.
* @note Makes sure that no spurious alarms are triggered after
@@ -89,11 +69,9 @@ static inline systime_t port_timer_get_time(void) {
*
* @notapi
*/
-static inline void port_timer_start_alarm(systime_t time) {
-
- chDbgAssert(stIsAlarmActive() == false, "already active");
-
- stStartAlarm(time);
+#define port_timer_start_alarm(time) { \
+ chDbgAssert(stIsAlarmActive() == false, "already active"); \
+ stStartAlarm(time); \
}
/**
@@ -101,11 +79,9 @@ static inline void port_timer_start_alarm(systime_t time) {
*
* @notapi
*/
-static inline void port_timer_stop_alarm(void) {
-
- chDbgAssert(stIsAlarmActive() != false, "not active");
-
- stStopAlarm();
+#define port_timer_stop_alarm() { \
+ chDbgAssert(stIsAlarmActive() != false, "not active"); \
+ stStopAlarm(); \
}
/**
@@ -115,11 +91,29 @@ static inline void port_timer_stop_alarm(void) {
*
* @notapi
*/
-static inline void port_timer_set_alarm(systime_t time) {
+#define port_timer_set_alarm(time) { \
+ chDbgAssert(stIsAlarmActive() != false, "not active"); \
+ stSetAlarm(time); \
+}
- chDbgAssert(stIsAlarmActive() != false, "not active");
+/*===========================================================================*/
+/* External declarations. */
+/*===========================================================================*/
- stSetAlarm(time);
+/*===========================================================================*/
+/* Module inline functions. */
+/*===========================================================================*/
+
+/**
+ * @brief Returns the system time.
+ *
+ * @return The system time.
+ *
+ * @notapi
+ */
+static inline systime_t port_timer_get_time(void) {
+
+ return stGetCounter();
}
/**
@@ -131,8 +125,6 @@ static inline void port_timer_set_alarm(systime_t time) {
*/
static inline systime_t port_timer_get_alarm(void) {
- chDbgAssert(stIsAlarmActive() != false, "not active");
-
return stGetAlarm();
}