From 4c5093c7e9cd837669487ad2eaf93db89248e975 Mon Sep 17 00:00:00 2001 From: Jerome Coutant Date: Fri, 1 Oct 2021 17:59:34 +0200 Subject: [PATCH] STM32WL: UART2 was missing --- .../TARGET_STM/TARGET_STM32WL/serial_device.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/targets/TARGET_STM/TARGET_STM32WL/serial_device.c b/targets/TARGET_STM/TARGET_STM32WL/serial_device.c index ed6023fc46..69fb58a219 100644 --- a/targets/TARGET_STM/TARGET_STM32WL/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32WL/serial_device.c @@ -65,6 +65,13 @@ static void uart1_irq(void) } #endif +#if defined(USART2_BASE) +static void uart2_irq(void) +{ + uart_irq(UART_2); +} +#endif + #if defined(LPUART1_BASE) static void lpuart1_irq(void) { @@ -94,6 +101,12 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) vector = (uint32_t)&uart1_irq; break; #endif +#if defined(USART2_BASE) + case UART_2: + irq_n = USART2_IRQn; + vector = (uint32_t)&uart2_irq; + break; +#endif #if defined(LPUART1_BASE) case LPUART_1: irq_n = LPUART1_IRQn; @@ -272,6 +285,11 @@ static IRQn_Type serial_get_irq_n(UARTName uart_name) irq_n = USART1_IRQn; break; #endif +#if defined(USART2_BASE) + case UART_2: + irq_n = USART2_IRQn; + break; +#endif #if defined(LPUART1_BASE) case LPUART_1: irq_n = LPUART1_IRQn;