From d23a911b60ccdf41dd86dc236c77c7fbea9b3258 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 29 Dec 2019 18:04:14 +0000 Subject: [PATCH] EXTI improvements for STM32G0xx. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13232 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16-40_41.inc | 8 ++++++++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti17.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti19.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti20.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21_22-29.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti22.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti23.inc | 3 +++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti30_32.inc | 8 ++++++++ os/hal/ports/STM32/LLD/EXTIv1/stm32_exti33.inc | 3 +++ os/hal/ports/STM32/STM32G0xx/stm32_isr.c | 5 +++++ 13 files changed, 51 insertions(+) diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16-40_41.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16-40_41.inc index 64280a79a..7212c18f3 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16-40_41.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16-40_41.inc @@ -84,6 +84,10 @@ OSAL_IRQ_HANDLER(STM32_EXTI164041_HANDLER) { #if defined(STM32_EXTI16_IS_USED) extiGetAndClearGroup1(1U << 16, pr); + + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI16_ISR) STM32_EXTI16_ISR(pr, 16); #endif @@ -91,6 +95,10 @@ OSAL_IRQ_HANDLER(STM32_EXTI164041_HANDLER) { #if defined(STM32_EXTI40_IS_USED) || defined(STM32_EXTI41_IS_USED) extiGetAndClearGroup2((1U << (40 - 32)) | (1U << (41 - 32)), pr); + + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI40_ISR) STM32_EXTI40_ISR(pr, 40); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16.inc index bfc68f7ba..d09ef3a32 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti16.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI16_HANDLER) { extiGetAndClearGroup1(1U << 16, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI16_ISR) STM32_EXTI16_ISR(pr, 16); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti17.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti17.inc index 0d51715e4..c2bbe0d0c 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti17.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti17.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI17_HANDLER) { extiGetAndClearGroup1(1U << 17, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI17_ISR) STM32_EXTI17_ISR(pr, 17); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc index 4892e774a..81e829072 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti18.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI18_HANDLER) { extiGetAndClearGroup1(1U << 18, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI18_ISR) STM32_EXTI18_ISR(pr, 18); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti19.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti19.inc index 4c3823e1a..ef4b8f8e1 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti19.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti19.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI19_HANDLER) { extiGetAndClearGroup1(1U << 19, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI19_ISR) STM32_EXTI19_ISR(pr, 19); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti20.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti20.inc index d0fea0e70..1d1b6af4a 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti20.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti20.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI20_HANDLER) { extiGetAndClearGroup1(1U << 20, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI20_ISR) STM32_EXTI20_ISR(pr, 20); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21.inc index ebe359b4f..350091bc5 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI21_HANDLER) { extiGetAndClearGroup1(1U << 21, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI21_ISR) STM32_EXTI21_ISR(pr, 21); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21_22-29.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21_22-29.inc index 0faf11bb2..95ea58709 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21_22-29.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti21_22-29.inc @@ -84,6 +84,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI212229_HANDLER) { extiGetAndClearGroup1((1U << 21) | (1U << 22) | (1U << 29), pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI21_ISR) STM32_EXTI21_ISR(pr, 21); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti22.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti22.inc index 849ea0a50..e958615a6 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti22.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti22.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI22_HANDLER) { extiGetAndClearGroup1(1U << 22, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI22_ISR) STM32_EXTI22_ISR(pr, 22); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti23.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti23.inc index ee4d4bcd8..3180234aa 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti23.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti23.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI23_HANDLER) { extiGetAndClearGroup1(1U << 23, pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI23_ISR) STM32_EXTI23_ISR(pr, 23); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti30_32.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti30_32.inc index 9b39f26ce..b8c1f4118 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti30_32.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti30_32.inc @@ -84,6 +84,10 @@ OSAL_IRQ_HANDLER(STM32_EXTI164041_HANDLER) { #if defined(STM32_EXTI30_IS_USED) || defined(STM32_EXTI31_IS_USED) extiGetAndClearGroup1((1U << 30) | (1U << 31), pr); + + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI30_ISR) STM32_EXTI30_ISR(pr, 30); #endif @@ -94,6 +98,10 @@ OSAL_IRQ_HANDLER(STM32_EXTI164041_HANDLER) { #if defined(STM32_EXTI32_IS_USED) extiGetAndClearGroup2(1U << (32 - 32), pr); + + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI32_ISR) STM32_EXTI32_ISR(pr, 32); #endif diff --git a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti33.inc b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti33.inc index c5fcecea9..3ad874f60 100644 --- a/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti33.inc +++ b/os/hal/ports/STM32/LLD/EXTIv1/stm32_exti33.inc @@ -81,6 +81,9 @@ OSAL_IRQ_HANDLER(STM32_EXTI33_HANDLER) { extiGetAndClearGroup2(1U << (33 - 32), pr); + /* Could be unused.*/ + (void)pr; + #if defined(STM32_EXTI33_ISR) STM32_EXTI33_ISR(pr, (33 - 32)); #endif diff --git a/os/hal/ports/STM32/STM32G0xx/stm32_isr.c b/os/hal/ports/STM32/STM32G0xx/stm32_isr.c index 14f0418ba..0dfa12879 100644 --- a/os/hal/ports/STM32/STM32G0xx/stm32_isr.c +++ b/os/hal/ports/STM32/STM32G0xx/stm32_isr.c @@ -35,6 +35,8 @@ } \ } +#define STM32_EXTI19_IS_USED + /*===========================================================================*/ /* Driver exported variables. */ /*===========================================================================*/ @@ -57,6 +59,7 @@ #include "stm32_exti0_1.inc" #include "stm32_exti2_3.inc" #include "stm32_exti4_15.inc" +#include "stm32_exti19-21.inc" #include "stm32_usart1.inc" #include "stm32_usart2.inc" @@ -86,6 +89,7 @@ void irqInit(void) { exti0_1_irq_init(); exti2_3_irq_init(); exti4_15_irq_init(); + exti19_exti21_irq_init(); tim1_irq_init(); tim2_irq_init(); @@ -112,6 +116,7 @@ void irqDeinit(void) { exti0_1_irq_deinit(); exti2_3_irq_deinit(); exti4_15_irq_deinit(); + exti19_exti21_irq_deinit(); tim1_irq_deinit(); tim2_irq_deinit();