diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/nil/ports/ARMCMx/nilcore.h | 4 | ||||
-rw-r--r-- | os/nil/templates/nilcore.h | 16 | ||||
-rw-r--r-- | os/rt/ports/ARMCMx/chcore.h | 2 |
3 files changed, 20 insertions, 2 deletions
diff --git a/os/nil/ports/ARMCMx/nilcore.h b/os/nil/ports/ARMCMx/nilcore.h index b7f60d1ff..9d9c643b4 100644 --- a/os/nil/ports/ARMCMx/nilcore.h +++ b/os/nil/ports/ARMCMx/nilcore.h @@ -221,13 +221,15 @@ struct port_intctx {}; #endif
#if !defined(_FROM_ASM_)
+
#if NIL_CFG_ST_TIMEDELTA > 0
#if !PORT_USE_ALT_TIMER
#include "nilcore_timer.h"
#else /* PORT_USE_ALT_TIMER */
#include "nilcore_timer_alt.h"
#endif /* PORT_USE_ALT_TIMER */
-#endif
+#endif /* NIL_CFG_ST_TIMEDELTA > 0 */
+
#endif /* !defined(_FROM_ASM_) */
#endif /* _NILCORE_H_ */
diff --git a/os/nil/templates/nilcore.h b/os/nil/templates/nilcore.h index 82f46d342..c49b425e1 100644 --- a/os/nil/templates/nilcore.h +++ b/os/nil/templates/nilcore.h @@ -96,6 +96,16 @@ #define PORT_INT_REQUIRED_STACK 32
#endif
+/**
+ * @brief Enables an alternative timer implementation.
+ * @details Usually the port uses a timer interface defined in the file
+ * @p nilcore_timer.h, if this option is enabled then the file
+ * @p nilcore_timer_alt.h is included instead.
+ */
+#if !defined(PORT_USE_ALT_TIMER)
+#define PORT_USE_ALT_TIMER FALSE
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
@@ -352,8 +362,12 @@ static inline rtcnt_t port_rt_get_counter_value(void) { #if !defined(_FROM_ASM_)
#if NIL_CFG_ST_TIMEDELTA > 0
+#if !PORT_USE_ALT_TIMER
#include "nilcore_timer.h"
-#endif
+#else /* PORT_USE_ALT_TIMER */
+#include "nilcore_timer_alt.h"
+#endif /* PORT_USE_ALT_TIMER */
+#endif /* NIL_CFG_ST_TIMEDELTA > 0 */
#endif /* !defined(_FROM_ASM_) */
diff --git a/os/rt/ports/ARMCMx/chcore.h b/os/rt/ports/ARMCMx/chcore.h index 1ad0026d9..ca6ae60e7 100644 --- a/os/rt/ports/ARMCMx/chcore.h +++ b/os/rt/ports/ARMCMx/chcore.h @@ -231,6 +231,7 @@ struct context { #endif
#if !defined(_FROM_ASM_)
+
#if CH_CFG_ST_TIMEDELTA > 0
#if !PORT_USE_ALT_TIMER
#include "chcore_timer.h"
@@ -238,6 +239,7 @@ struct context { #include "chcore_timer_alt.h"
#endif /* PORT_USE_ALT_TIMER */
#endif /* CH_CFG_ST_TIMEDELTA > 0 */
+
#endif /* !defined(_FROM_ASM_) */
#endif /* _CHCORE_H_ */
|