diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-21 13:33:40 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-08-21 13:33:40 +0000 |
commit | 78b866e0a7046a893025fe1304064f255e37c411 (patch) | |
tree | 259b7140402d9a34768380ff0fdd5fa8a7e7bdfe /os/rt | |
parent | 371ef2afb5b7045d8293dd5a393a7783b025f8a8 (diff) | |
download | ChibiOS-78b866e0a7046a893025fe1304064f255e37c411.tar.gz ChibiOS-78b866e0a7046a893025fe1304064f255e37c411.tar.bz2 ChibiOS-78b866e0a7046a893025fe1304064f255e37c411.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6192 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt')
-rw-r--r-- | os/rt/ports/ARMCMx/devices/STM32F0xx/systick.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/os/rt/ports/ARMCMx/devices/STM32F0xx/systick.h b/os/rt/ports/ARMCMx/devices/STM32F0xx/systick.h index 585eecd61..e61926c7e 100644 --- a/os/rt/ports/ARMCMx/devices/STM32F0xx/systick.h +++ b/os/rt/ports/ARMCMx/devices/STM32F0xx/systick.h @@ -19,16 +19,23 @@ */
/**
- * @file STM32F30x/systick.h
+ * @file ARMCMx/systick.h
* @brief System timer header file.
*
- * @addtogroup STM32F30X_TIMER
+ * @addtogroup ARMCMx_SYSTICK
* @{
*/
#ifndef _SYSTICK_H_
#define _SYSTICK_H_
+#if defined(CH_PORT_DO_NOT_USE_ST)
+#include "systick_ext.h"
+
+#else /* !defined(CH_PORT_DO_NOT_USE_ST) */
+
+#include "st.h"
+
/*===========================================================================*/
/* Module constants. */
/*===========================================================================*/
@@ -66,7 +73,7 @@ */
static inline systime_t port_timer_get_time(void) {
- return TIM2->CNT;
+ return stGetCounter();
}
/**
@@ -80,11 +87,7 @@ static inline systime_t port_timer_get_time(void) { */
static inline void port_timer_start_alarm(systime_t time) {
- chDbgAssert((TIM2->DIER & 2) == 0, "already started");
-
- TIM2->CCR1 = time;
- TIM2->SR = 0;
- TIM2->DIER = 2; /* CC1IE */
+ stStartAlarm(time);
}
/**
@@ -94,9 +97,7 @@ static inline void port_timer_start_alarm(systime_t time) { */
static inline void port_timer_stop_alarm(void) {
- chDbgAssert((TIM2->DIER & 2) != 0, "not started");
-
- TIM2->DIER = 0;
+ stStopAlarm();
}
/**
@@ -108,9 +109,7 @@ static inline void port_timer_stop_alarm(void) { */
static inline void port_timer_set_alarm(systime_t time) {
- chDbgAssert((TIM2->DIER & 2) != 0, "not started");
-
- TIM2->CCR1 = time;
+ stSetAlarm(time);
}
/**
@@ -122,11 +121,11 @@ static inline void port_timer_set_alarm(systime_t time) { */
static inline systime_t port_timer_get_alarm(void) {
- chDbgAssert((TIM2->DIER & 2) != 0, "not started");
-
- return TIM2->CCR1;
+ return stGetAlarm();
}
+#endif /* !defined(CH_PORT_DO_NOT_USE_ST) */
+
#endif /* _SYSTICK_H_ */
/** @} */
|