Merge pull request #76 from sdalu/priority
Enable priority validation, Fixed priorirty (nRF51 use a 2bit priority)
This commit is contained in:
commit
394a779ade
|
@ -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. */
|
||||
|
|
|
@ -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. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -82,21 +82,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
|
||||
|
||||
/**
|
||||
|
@ -120,6 +120,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. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -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. */
|
||||
|
|
|
@ -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. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -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. */
|
||||
/*===========================================================================*/
|
||||
|
|
|
@ -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. */
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Reference in New Issue