aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-01-20 13:00:57 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-01-20 13:00:57 +0000
commitfb6967cd23dbaee0c49c1447a159bd90e2860817 (patch)
treed47027c21c2116edf883495847b04b341eb8fb4a /os
parent151ca1d309f2d350527a73676c5aa47f5c2fa921 (diff)
downloadChibiOS-fb6967cd23dbaee0c49c1447a159bd90e2860817.tar.gz
ChibiOS-fb6967cd23dbaee0c49c1447a159bd90e2860817.tar.bz2
ChibiOS-fb6967cd23dbaee0c49c1447a159bd90e2860817.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6635 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/rt/ports/ARMCMx/chcore.h16
-rw-r--r--os/rt/ports/ARMCMx/chcore_timer.h10
2 files changed, 15 insertions, 11 deletions
diff --git a/os/rt/ports/ARMCMx/chcore.h b/os/rt/ports/ARMCMx/chcore.h
index 91231505f..1ad0026d9 100644
--- a/os/rt/ports/ARMCMx/chcore.h
+++ b/os/rt/ports/ARMCMx/chcore.h
@@ -77,6 +77,16 @@
/* Module pre-compile time settings. */
/*===========================================================================*/
+/**
+ * @brief Enables an alternative timer implementation.
+ * @details Usually the port uses a timer interface defined in the file
+ * @p chcore_timer.h, if this option is enabled then the file
+ * @p chcore_timer_alt.h is included instead.
+ */
+#if !defined(PORT_USE_ALT_TIMER)
+#define PORT_USE_ALT_TIMER FALSE
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -222,8 +232,12 @@ struct context {
#if !defined(_FROM_ASM_)
#if CH_CFG_ST_TIMEDELTA > 0
+#if !PORT_USE_ALT_TIMER
#include "chcore_timer.h"
-#endif
+#else /* PORT_USE_ALT_TIMER */
+#include "chcore_timer_alt.h"
+#endif /* PORT_USE_ALT_TIMER */
+#endif /* CH_CFG_ST_TIMEDELTA > 0 */
#endif /* !defined(_FROM_ASM_) */
#endif /* _CHCORE_H_ */
diff --git a/os/rt/ports/ARMCMx/chcore_timer.h b/os/rt/ports/ARMCMx/chcore_timer.h
index 0ddf0a9bb..8df7ac97e 100644
--- a/os/rt/ports/ARMCMx/chcore_timer.h
+++ b/os/rt/ports/ARMCMx/chcore_timer.h
@@ -29,14 +29,6 @@
#ifndef _CHCORE_TIMER_H_
#define _CHCORE_TIMER_H_
-#if defined(PORT_DO_NOT_USE_ST)
-/* If, for some reason, the use of the HAL-provided ST timer port interface
- is not wanted, it is possible to provide the timer interface into a custom
- module.*/
-#include "chcore_timer_ext.h"
-
-#else /* !defined(PORT_DO_NOT_USE_ST) */
-
/* This is the only header in the HAL designed to be include-able alone.*/
#include "st.h"
@@ -128,8 +120,6 @@ static inline systime_t port_timer_get_alarm(void) {
return stGetAlarm();
}
-#endif /* !defined(PORT_DO_NOT_USE_ST) */
-
#endif /* _CHCORE_TIMER_H_ */
/** @} */