Skip to content

Commit 0d9604d

Browse files
committed
chore(exti): add HAL v2 support
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent ee5346d commit 0d9604d

3 files changed

Lines changed: 236 additions & 23 deletions

File tree

‎cores/arduino/WInterrupts.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,23 @@ void attachInterrupt(pin_size_t interruptNumber, callback_function_t callback, P
3030

3131
switch (mode) {
3232
case CHANGE :
33+
#if defined(GPIO_MODE_IT_RISING_FALLING)
3334
it_mode = GPIO_MODE_IT_RISING_FALLING;
35+
#else
36+
it_mode = HAL_EXTI_TRIGGER_RISING_FALLING;
37+
#endif
3438
break;
3539
case LOW :
3640
#ifdef GPIO_MODE_IT_LEVEL_LOW
3741
it_mode = GPIO_MODE_IT_LEVEL_LOW;
3842
break;
3943
#endif
4044
case FALLING :
45+
#if defined(GPIO_MODE_IT_FALLING)
4146
it_mode = GPIO_MODE_IT_FALLING;
47+
#else
48+
it_mode = HAL_EXTI_TRIGGER_FALLING;
49+
#endif
4250
break;
4351
case HIGH :
4452
#ifdef GPIO_MODE_IT_LEVEL_HIGH
@@ -47,7 +55,11 @@ void attachInterrupt(pin_size_t interruptNumber, callback_function_t callback, P
4755
#endif
4856
default:
4957
case RISING :
58+
#if defined(GPIO_MODE_IT_RISING)
5059
it_mode = GPIO_MODE_IT_RISING;
60+
#else
61+
it_mode = HAL_EXTI_TRIGGER_RISING;
62+
#endif
5163
break;
5264
}
5365

‎cores/arduino/stm32/stm32yyxx_hal_conf.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Mandatory HALv2 modules
77
*/
88
#define USE_HAL_CORTEX_MODULE 1U
9+
#define USE_HAL_EXTI_MODULE 1U
910
#define USE_HAL_FLASH_MODULE 1U
1011
#define USE_HAL_GPIO_MODULE 1U
1112
#define USE_HAL_RCC_MODULE 1U

0 commit comments

Comments
 (0)