Revert "remove 5..9 handler"

This commit is contained in:
Stefan Kerkmann 2021-04-05 17:06:30 +02:00
parent 0104b80b23
commit b047b96764
2 changed files with 36 additions and 0 deletions

View File

@ -158,6 +158,32 @@ OSAL_IRQ_HANDLER(vector29) {
}
#endif
#if !defined(GD32_DISABLE_EXTI5_9_HANDLER)
/**
* @brief EXTI[5]...EXTI[9] interrupt handler.
*
* @isr
*/
OSAL_IRQ_HANDLER(Vector9C) {
uint32_t pd;
OSAL_IRQ_PROLOGUE();
pd = EXTI->PD;
pd &= EXTI->INTEN & ((1U << 5) | (1U << 6) | (1U << 7) | (1U << 8) | (1U << 9));
EXTI->PD = pd;
exti_serve_irq(pd, 5);
exti_serve_irq(pd, 6);
exti_serve_irq(pd, 7);
exti_serve_irq(pd, 8);
exti_serve_irq(pd, 9);
OSAL_IRQ_EPILOGUE();
}
#endif
#if !defined(GD32_DISABLE_EXTI10_15_HANDLER)
/**
* @brief EXTI[10]...EXTI[15] interrupt handler.
@ -224,6 +250,7 @@ void irqInit(void) {
eclicEnableVector(EXTI2_IRQn, GD32_IRQ_EXTI2_PRIORITY, GD32_IRQ_EXTI2_TRIGGER);
eclicEnableVector(EXTI3_IRQn, GD32_IRQ_EXTI3_PRIORITY, GD32_IRQ_EXTI3_TRIGGER);
eclicEnableVector(EXTI4_IRQn, GD32_IRQ_EXTI4_PRIORITY, GD32_IRQ_EXTI4_TRIGGER);
eclicEnableVector(EXTI5_9_IRQn, GD32_IRQ_EXTI5_9_PRIORITY, GD32_IRQ_EXTI5_9_TRIGGER);
eclicEnableVector(EXTI10_15_IRQn, GD32_IRQ_EXTI10_15_PRIORITY, GD32_IRQ_EXTI10_15_TRIGGER);
#endif
}
@ -241,6 +268,7 @@ void irqDeinit(void) {
eclicDisableVector(EXTI2_IRQn);
eclicDisableVector(EXTI3_IRQn);
eclicDisableVector(EXTI4_IRQn);
eclicDisableVector(EXTI5_9_IRQn);
eclicDisableVector(EXTI10_15_IRQn);
#endif
}

View File

@ -159,6 +159,13 @@
#define GD32_IRQ_EXTI4_PRIORITY 6
#endif
/**
* @brief EXTI9..5 interrupt priority level setting.
*/
#if !defined(GD32_IRQ_EXTI5_9_PRIORITY) || defined(__DOXYGEN__)
#define GD32_IRQ_EXTI5_9_PRIORITY 6
#endif
/**
* @brief EXTI15..10 interrupt priority level setting.
*/
@ -183,6 +190,7 @@
#define GD32_IRQ_EXTI2_TRIGGER ECLIC_TRIGGER_DEFAULT
#define GD32_IRQ_EXTI3_TRIGGER ECLIC_TRIGGER_DEFAULT
#define GD32_IRQ_EXTI4_TRIGGER ECLIC_TRIGGER_DEFAULT
#define GD32_IRQ_EXTI5_9_TRIGGER ECLIC_TRIGGER_DEFAULT
#define GD32_IRQ_EXTI10_15_TRIGGER ECLIC_TRIGGER_DEFAULT
#define GD32_GPT_TIM0_IRQ_TRIGGER ECLIC_TRIGGER_DEFAULT