Skip to content

Commit 1c583c0

Browse files
committed
STM32G0: no TIM2 for G070xx
1 parent 4c29451 commit 1c583c0

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

targets/TARGET_STM/TARGET_STM32G0/us_ticker_data.h

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#include "stm32g0xx.h"
2323
#include "stm32g0xx_ll_tim.h"
2424
#include "cmsis_nvic.h"
25-
25+
26+
#if defined TIM2_BASE
27+
2628
#define TIM_MST TIM2
2729
#define TIM_MST_IRQ TIM2_IRQn
2830
#define TIM_MST_RCC __TIM2_CLK_ENABLE()
@@ -31,6 +33,18 @@
3133
#define TIM_MST_RESET_ON __TIM2_FORCE_RESET()
3234
#define TIM_MST_RESET_OFF __TIM2_RELEASE_RESET()
3335

36+
#else
37+
38+
#define TIM_MST TIM3
39+
#define TIM_MST_IRQ TIM3_IRQn
40+
#define TIM_MST_RCC __TIM3_CLK_ENABLE()
41+
#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM3()
42+
43+
#define TIM_MST_RESET_ON __TIM3_FORCE_RESET()
44+
#define TIM_MST_RESET_OFF __TIM3_RELEASE_RESET()
45+
46+
#endif
47+
3448
#define TIM_MST_BIT_WIDTH 32 // 16 or 32
3549

3650
#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2)

0 commit comments

Comments
 (0)