aboutsummaryrefslogtreecommitdiffstats
path: root/os/nil/templates/nilcore.h
diff options
context:
space:
mode:
Diffstat (limited to 'os/nil/templates/nilcore.h')
-rw-r--r--os/nil/templates/nilcore.h16
1 files changed, 15 insertions, 1 deletions
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_) */