aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/NRF51/NRF51822/st_lld.h
diff options
context:
space:
mode:
authorStephane D'Alu <sdalu@sdalu.com>2016-02-05 23:54:23 +0100
committerStephane D'Alu <sdalu@sdalu.com>2016-02-05 23:54:23 +0100
commit8fe62a0f907639db23f14d17a45a7970854f1d22 (patch)
tree94ed5d7c466003fabd19065fc74906d30dced297 /os/hal/ports/NRF51/NRF51822/st_lld.h
parent80af295f27f0fc5daaaea04cb249d3ad3704d338 (diff)
downloadChibiOS-Contrib-8fe62a0f907639db23f14d17a45a7970854f1d22.tar.gz
ChibiOS-Contrib-8fe62a0f907639db23f14d17a45a7970854f1d22.tar.bz2
ChibiOS-Contrib-8fe62a0f907639db23f14d17a45a7970854f1d22.zip
use mcuconf.h with NRF51_SYSTEM_TICKS to select the timer source (TIMER or RTC)
Diffstat (limited to 'os/hal/ports/NRF51/NRF51822/st_lld.h')
-rw-r--r--os/hal/ports/NRF51/NRF51822/st_lld.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/os/hal/ports/NRF51/NRF51822/st_lld.h b/os/hal/ports/NRF51/NRF51822/st_lld.h
index 2e0672e..c62ff2c 100644
--- a/os/hal/ports/NRF51/NRF51822/st_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/st_lld.h
@@ -31,14 +31,39 @@
/* Driver constants. */
/*===========================================================================*/
+/**
+ * @brief SPI0 interrupt priority level setting.
+ */
+#define NRF51_SYSTEM_TICKS_AS_TIMER 1
+
+/**
+ * @brief SPI0 interrupt priority level setting.
+ */
+#define NRF51_SYSTEM_TICKS_AS_RTC 2
+
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
+/**
+ * @brief Select the method to generates system ticks
+ * @details Possibles values are:
+ * NRF51_SYSTEM_TICKS_AS_TIMER for TIMER0
+ * NRF51_SYSTEM_TICKS_AS_RTC for RTC0
+ */
+#if !defined(NRF51_SYSTEM_TICKS) || defined(__DOXYGEN__)
+#define NRF51_SYSTEM_TICKS NRF51_SYSTEM_TICKS_AS_RTC
+#endif
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
+#if ((NRF51_SYSTEM_TICKS != NRF51_SYSTEM_TICKS_AS_RTC) && \
+ (NRF51_SYSTEM_TICKS != NRF51_SYSTEM_TICKS_AS_TIMER))
+#error "NRF51_SYSTEM_TICKS illegal value"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/