aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/ports')
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_gpt_lld.h8
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_i2c_lld.h14
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_pwm_lld.h22
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_rng_lld.h6
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_serial_lld.h7
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_spi_lld.h14
-rw-r--r--os/hal/ports/NRF51/NRF51822/hal_st_lld.h6
7 files changed, 62 insertions, 15 deletions
diff --git a/os/hal/ports/NRF51/NRF51822/hal_gpt_lld.h b/os/hal/ports/NRF51/NRF51822/hal_gpt_lld.h
index 748be0a..9b4cc9b 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_gpt_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_gpt_lld.h
@@ -70,21 +70,21 @@
* @brief GPTD1 interrupt priority level setting.
*/
#if !defined(NRF51_GPT_TIMER0_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_GPT_TIMER0_IRQ_PRIORITY 7
+#define NRF51_GPT_TIMER0_IRQ_PRIORITY 3
#endif
/**
* @brief GPTD2 interrupt priority level setting.
*/
#if !defined(NRF51_GPT_TIMER1_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_GPT_TIMER1_IRQ_PRIORITY 7
+#define NRF51_GPT_TIMER1_IRQ_PRIORITY 3
#endif
/**
* @brief GPTD3 interrupt priority level setting.
*/
#if !defined(NRF51_GPT_TIMER2_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_GPT_TIMER2_IRQ_PRIORITY 7
+#define NRF51_GPT_TIMER2_IRQ_PRIORITY 3
#endif
/** @} */
@@ -97,7 +97,6 @@
#error "GPT driver activated but no TIMER peripheral assigned"
#endif
-#if 0
#if NRF51_GPT_USE_TIMER0 && \
!OSAL_IRQ_IS_VALID_PRIORITY(NRF51_GPT_TIMER0_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to TIMER0"
@@ -112,7 +111,6 @@
!OSAL_IRQ_IS_VALID_PRIORITY(NRF51_GPT_TIMER2_IRQ_PRIORITY)
#error "Invalid IRQ priority assigned to TIMER2"
#endif
-#endif
/*===========================================================================*/
/* Driver data structures and types. */
diff --git a/os/hal/ports/NRF51/NRF51822/hal_i2c_lld.h b/os/hal/ports/NRF51/NRF51822/hal_i2c_lld.h
index 555ced1..e2c3d07 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_i2c_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_i2c_lld.h
@@ -66,14 +66,14 @@
* @brief I2C0 interrupt priority level setting.
*/
#if !defined(NRF51_I2C_I2C0_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_I2C_I2C0_IRQ_PRIORITY 10
+#define NRF51_I2C_I2C0_IRQ_PRIORITY 3
#endif
/**
* @brief I2C1 interrupt priority level setting.
*/
#if !defined(NRF51_I2C_I2C1_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_I2C_I2C1_IRQ_PRIORITY 10
+#define NRF51_I2C_I2C1_IRQ_PRIORITY 3
#endif
/** @} */
@@ -81,6 +81,16 @@
/* Derived constants and error checks. */
/*===========================================================================*/
+#if NRF51_I2C_USE_I2C0 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_I2C_I2C0_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to I2C0"
+#endif
+
+#if NRF51_I2C_USE_I2C1 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_I2C_I2C1_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to I2C1"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/ports/NRF51/NRF51822/hal_pwm_lld.h b/os/hal/ports/NRF51/NRF51822/hal_pwm_lld.h
index 0ddd65c..0589bf1 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_pwm_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_pwm_lld.h
@@ -68,21 +68,21 @@
* @brief TIMER0 interrupt priority level setting.
*/
#if !defined(NRF51_PWM_TIMER0_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_PWM_TIMER0_PRIORITY 12
+#define NRF51_PWM_TIMER0_PRIORITY 3
#endif
/**
* @brief TIMER1 interrupt priority level setting.
*/
#if !defined(NRF51_PWM_TIMER1_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_PWM_TIMER1_PRIORITY 12
+#define NRF51_PWM_TIMER1_PRIORITY 3
#endif
/**
* @brief TIMER2 interrupt priority level setting.
*/
#if !defined(NRF51_PWM_TIMER2_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_PWM_TIMER2_PRIORITY 12
+#define NRF51_PWM_TIMER2_PRIORITY 3
#endif
/** @} */
@@ -105,6 +105,22 @@
#error "TIMER0 used for ST and PWM"
#endif
+#if NRF51_PWM_USE_TIMER0 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_PWM_TIMER0_PRIORITY)
+#error "Invalid IRQ priority assigned to TIMER0"
+#endif
+
+#if NRF51_PWM_USE_TIMER1 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_PWM_TIMER1_PRIORITY)
+#error "Invalid IRQ priority assigned to TIMER1"
+#endif
+
+#if NRF51_PWM_USE_TIMER2 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_PWM_TIMER2_PRIORITY)
+#error "Invalid IRQ priority assigned to TIMER2"
+#endif
+
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/ports/NRF51/NRF51822/hal_rng_lld.h b/os/hal/ports/NRF51/NRF51822/hal_rng_lld.h
index 475770b..0ad0bc6 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_rng_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_rng_lld.h
@@ -61,7 +61,7 @@
* @brief RNG1 interrupt priority level setting.
*/
#if !defined(NRF51_RNG_RNG1_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_RNG_RNG1_IRQ_PRIORITY 10
+#define NRF51_RNG_RNG1_IRQ_PRIORITY 3
#endif
@@ -69,6 +69,10 @@
/* Derived constants and error checks. */
/*===========================================================================*/
+#if NRF51_RNG_USE_RNG1 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_RNG_RNG1_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to RNG1"
+#endif
/*===========================================================================*/
/* Driver data structures and types. */
diff --git a/os/hal/ports/NRF51/NRF51822/hal_serial_lld.h b/os/hal/ports/NRF51/NRF51822/hal_serial_lld.h
index 304c07d..79955b1 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_serial_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_serial_lld.h
@@ -62,7 +62,7 @@
* @brief UART0 interrupt priority level setting.
*/
#if !defined(NRF51_SERIAL_UART0_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_SERIAL_UART0_PRIORITY 12
+#define NRF51_SERIAL_UART0_PRIORITY 3
#endif
/* Value indicating that no pad is connected to this UART register. */
@@ -75,6 +75,11 @@
/* Derived constants and error checks. */
/*===========================================================================*/
+#if NRF51_SERIAL_USE_UART0 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_SERIAL_UART0_PRIORITY)
+#error "Invalid IRQ priority assigned to UART0"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/ports/NRF51/NRF51822/hal_spi_lld.h b/os/hal/ports/NRF51/NRF51822/hal_spi_lld.h
index d339a91..4d1c452 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_spi_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_spi_lld.h
@@ -39,14 +39,14 @@
* @brief SPI0 interrupt priority level setting.
*/
#if !defined(NRF51_SPI_SPI0_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_SPI_SPI0_IRQ_PRIORITY 10
+#define NRF51_SPI_SPI0_IRQ_PRIORITY 3
#endif
/**
* @brief SPI1 interrupt priority level setting.
*/
#if !defined(NRF51_SPI_SPI1_IRQ_PRIORITY) || defined(__DOXYGEN__)
-#define NRF51_SPI_SPI1_IRQ_PRIORITY 10
+#define NRF51_SPI_SPI1_IRQ_PRIORITY 3
#endif
/**
@@ -65,6 +65,16 @@
#error "SPI driver activated but no SPI peripheral assigned"
#endif
+#if NRF51_SPI_USE_SPI0 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_SPI_SPI0_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to SPI0"
+#endif
+
+#if NRF51_SPI_USE_SPI1 && \
+ !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_SPI_SPI1_IRQ_PRIORITY)
+#error "Invalid IRQ priority assigned to SPI1"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
diff --git a/os/hal/ports/NRF51/NRF51822/hal_st_lld.h b/os/hal/ports/NRF51/NRF51822/hal_st_lld.h
index bde9950..8d12d2e 100644
--- a/os/hal/ports/NRF51/NRF51822/hal_st_lld.h
+++ b/os/hal/ports/NRF51/NRF51822/hal_st_lld.h
@@ -71,7 +71,7 @@
*/
#if !defined(NRF51_ST_PRIORITY) || defined(__DOXYGEN__)
#if !defined(SOFTDEVICE_PRESENT)
-#define NRF51_ST_PRIORITY 8
+#define NRF51_ST_PRIORITY 1
#else
#define NRF51_ST_PRIORITY 1
#endif
@@ -123,6 +123,10 @@
#endif
#endif /* OSAL_ST_MODE == OSAL_ST_MODE_FREERUNNING */
+#if !OSAL_IRQ_IS_VALID_PRIORITY(NRF51_ST_PRIORITY)
+#error "Invalid IRQ priority assigned to ST driver"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/