From 9d0c6fb8bf7bf63c137d7c19fdefc7760d2f133a Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 3 Sep 2013 08:48:20 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6250 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/ports/ARMCMx/chcore_timer.h | 62 +++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 35 deletions(-) (limited to 'os/rt/ports/ARMCMx/chcore_timer.h') 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(); } -- cgit v1.2.3