aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorKonstantin K. Oblaukhov <oblaukhov@sl.iae.nsk.su>2019-04-09 16:25:54 +0700
committerKonstantin K. Oblaukhov <oblaukhov@sl.iae.nsk.su>2019-04-09 16:25:54 +0700
commit6fab9821ebd6bda8c21654513bcec8dddb46748e (patch)
tree3ad585cddf3616d178ba62e3875f5e99bd2247cb /os
parent6dc1071c9f5f470dc4956ce78d59040499b76e07 (diff)
downloadChibiOS-Contrib-6fab9821ebd6bda8c21654513bcec8dddb46748e.tar.gz
ChibiOS-Contrib-6fab9821ebd6bda8c21654513bcec8dddb46748e.tar.bz2
ChibiOS-Contrib-6fab9821ebd6bda8c21654513bcec8dddb46748e.zip
Merge ICU (in GPIOTE mode) and PAL interrupts.
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/NRF5/LLD/TIMERv1/hal_icu_lld.c19
-rw-r--r--os/hal/ports/NRF5/NRF52832/nrf52_isr.c16
2 files changed, 13 insertions, 22 deletions
diff --git a/os/hal/ports/NRF5/LLD/TIMERv1/hal_icu_lld.c b/os/hal/ports/NRF5/LLD/TIMERv1/hal_icu_lld.c
index 4966007..bca8855 100644
--- a/os/hal/ports/NRF5/LLD/TIMERv1/hal_icu_lld.c
+++ b/os/hal/ports/NRF5/LLD/TIMERv1/hal_icu_lld.c
@@ -301,25 +301,6 @@ static void start_channels(ICUDriver *icup) {
/* Driver interrupt handlers. */
/*===========================================================================*/
-#if NRF5_ICU_USE_GPIOTE_PPI
-/**
- * @brief GPIOTE events interrupt handler.
- * @note It is assumed that the various sources are only activated if the
- * associated callback pointer is not equal to @p NULL in order to not
- * perform an extra check in a potentially critical interrupt handler.
- *
- * @isr
- */
-OSAL_IRQ_HANDLER(Vector58) {
-
- OSAL_IRQ_PROLOGUE();
-
- icu_lld_serve_gpiote_interrupt(&ICUD1);
-
- OSAL_IRQ_EPILOGUE();
-}
-#endif /* NRF5_ICU_USE_GPIOTE_PPI */
-
#if NRF5_ICU_USE_TIMER0
/**
* @brief TIMER0 compare interrupt handler.
diff --git a/os/hal/ports/NRF5/NRF52832/nrf52_isr.c b/os/hal/ports/NRF5/NRF52832/nrf52_isr.c
index 7374f36..431bb3b 100644
--- a/os/hal/ports/NRF5/NRF52832/nrf52_isr.c
+++ b/os/hal/ports/NRF5/NRF52832/nrf52_isr.c
@@ -41,6 +41,10 @@
/* Driver local functions. */
/*===========================================================================*/
+#if (HAL_USE_ICU && NRF5_ICU_USE_GPIOTE_PPI)
+extern void icu_lld_serve_gpiote_interrupt(ICUDriver *icup);
+#endif
+
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
@@ -53,15 +57,21 @@
OSAL_IRQ_HANDLER(Vector58) {
OSAL_IRQ_PROLOGUE();
-
+
+#if (HAL_USE_ICU && NRF5_ICU_USE_GPIOTE_PPI)
+ icu_lld_serve_gpiote_interrupt(&ICUD1);
+#endif
+
+#if (HAL_USE_PAL && (PAL_USE_WAIT || PAL_USE_CALLBACKS))
for (int ch = 0; ch < NRF5_GPIOTE_NUM_CHANNELS; ch++)
{
if (NRF_GPIOTE->EVENTS_IN[ch])
{
- NRF_GPIOTE->EVENTS_IN[ch] = 0;
- _pal_isr_code(ch);
+ NRF_GPIOTE->EVENTS_IN[ch] = 0;
+ _pal_isr_code(ch);
}
}
+#endif
OSAL_IRQ_EPILOGUE();
}