Skip to content

Commit

Permalink
[G0] Fix Timer and USART IRQ definition
Browse files Browse the repository at this point in the history
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
  • Loading branch information
fpistm committed Aug 6, 2020
1 parent d89c283 commit bb0edc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cores/arduino/stm32/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ extern "C" {
#endif
#endif
#if defined(TIM7_BASE) && !defined(TIM7_IRQn)
#if defined(STM32G0xx)
#if defined(STM32G0xx) && defined(LPTIM2_BASE)
#define TIM7_IRQn TIM7_LPTIM2_IRQn
#define TIM7_IRQHandler TIM7_LPTIM2_IRQHandler
#elif defined(STM32G4xx)
Expand Down
15 changes: 12 additions & 3 deletions cores/arduino/stm32/uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ struct serial_s {
#endif /* STM32F091xC || STM32F098xx */
#endif /* STM32F0xx */

#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
#if defined(STM32G0xx)
#if defined(LPUART1_BASE)
#define USART3_IRQn USART3_4_LPUART1_IRQn
#define USART3_IRQHandler USART3_4_LPUART1_IRQHandler
#else
#define USART3_IRQn USART3_4_IRQn
#define USART3_IRQHandler USART3_4_IRQHandler
#endif
#endif /* STM32G0xx */
#endif

Expand All @@ -118,8 +123,12 @@ struct serial_s {
#elif defined(STM32L0xx)
#define USART4_IRQn USART4_5_IRQn
#endif /* STM32F0xx */
#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
#if defined(STM32G0xx)
#if defined(LPUART1_BASE)
#define USART4_IRQn USART3_4_LPUART1_IRQn
#else
#define USART4_IRQn USART3_4_IRQn
#endif
#endif /* STM32G0xx */

#endif
Expand Down Expand Up @@ -160,7 +169,7 @@ struct serial_s {
#endif
#endif /* STM32F0xx */

#if defined(STM32G0xx) && !defined(STM32G030xx) && !defined(STM32G031xx) && !defined(STM32G041xx)
#if defined(STM32G0xx) && !defined(USART3_BASE)
#if defined(LPUART1_BASE) && !defined(LPUART1_IRQn)
#define LPUART1_IRQn USART3_4_LPUART1_IRQn
#endif
Expand Down

0 comments on commit bb0edc2

Please sign in to comment.