From 960847273c5015002fff1bb7c483556140746de2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 23 Aug 2013 07:57:26 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6205 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/ports/ARMCMx/chcore_timer.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'os/rt/ports') diff --git a/os/rt/ports/ARMCMx/chcore_timer.h b/os/rt/ports/ARMCMx/chcore_timer.h index 089ab2519..da3bd82de 100644 --- a/os/rt/ports/ARMCMx/chcore_timer.h +++ b/os/rt/ports/ARMCMx/chcore_timer.h @@ -37,6 +37,7 @@ #else /* !defined(CH_PORT_DO_NOT_USE_ST) */ +/* This is the only header in the HAL designed to be include-able alone.*/ #include "st.h" /*===========================================================================*/ @@ -90,6 +91,8 @@ static inline systime_t port_timer_get_time(void) { */ static inline void port_timer_start_alarm(systime_t time) { + chDbgAssert(stIsAlarmActive() == false, "already active"); + stStartAlarm(time); } @@ -100,6 +103,8 @@ static inline void port_timer_start_alarm(systime_t time) { */ static inline void port_timer_stop_alarm(void) { + chDbgAssert(stIsAlarmActive() != false, "not active"); + stStopAlarm(); } @@ -112,6 +117,8 @@ static inline void port_timer_stop_alarm(void) { */ static inline void port_timer_set_alarm(systime_t time) { + chDbgAssert(stIsAlarmActive() != false, "not active"); + stSetAlarm(time); } @@ -124,6 +131,8 @@ 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