aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/ports/ARMCMx/chcore_timer.h
diff options
context:
space:
mode:
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();
}