diff options
-rw-r--r-- | os/rt/ports/ARMCMx/chcore.h | 16 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/chcore_timer.h | 10 |
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_ */
/** @} */
|