Skip to content

Commit 53b8f40

Browse files
committed
Add GD32F30X TIMER7 definitions for soft UART
Introduce a GD32F30X-specific preprocessor branch in lib-gd32/src/softuart0/uart0.cpp that maps TIMERx to TIMER7 and sets RCU_TIMERx, TIMERx_IRQHandler, and TIMERx_IRQn accordingly. This enables the soft UART code to compile and use the correct timer/IRQ on GD32F30X devices.
1 parent b9824b3 commit 53b8f40

2 files changed

Lines changed: 5 additions & 43 deletions

File tree

lib-gd32/include/device/host/host.h

Lines changed: 0 additions & 43 deletions
This file was deleted.

lib-gd32/src/softuart0/uart0.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
#define RCU_TIMERx RCU_TIMER15
3333
#define TIMERx_IRQHandler TIMER15_IRQHandler
3434
#define TIMERx_IRQn TIMER15_IRQn
35+
#elif defined(GD32F30X)
36+
#define TIMERx TIMER7
37+
#define RCU_TIMERx RCU_TIMER7
38+
#define TIMERx_IRQHandler TIMER7_UP_IRQHandler
39+
#define TIMERx_IRQn TIMER7_UP_IRQn
3540
#else
3641
#define TIMERx TIMER9
3742
#define RCU_TIMERx RCU_TIMER9

0 commit comments

Comments
 (0)