From 8b55e3ffb2be97dae81c2595a062094444e95ba7 Mon Sep 17 00:00:00 2001 From: Kevin Berner Date: Thu, 18 Feb 2021 11:38:07 -0600 Subject: [PATCH] Fix G473 AF5 Timers --- src/main/drivers/timer.h | 2 +- src/main/drivers/timer_def.h | 4 ++++ src/main/drivers/timer_stm32g4xx.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/timer.h b/src/main/drivers/timer.h index bd866d723f..82f0008878 100644 --- a/src/main/drivers/timer.h +++ b/src/main/drivers/timer.h @@ -176,7 +176,7 @@ extern const timerHardware_t timerHardware[]; #elif defined(STM32G4) -#define FULL_TIMER_CHANNEL_COUNT 91 // XXX Need review +#define FULL_TIMER_CHANNEL_COUNT 93 // XXX Need review #endif diff --git a/src/main/drivers/timer_def.h b/src/main/drivers/timer_def.h index d4656e1a15..c1dbc03d2d 100644 --- a/src/main/drivers/timer_def.h +++ b/src/main/drivers/timer_def.h @@ -1288,6 +1288,8 @@ #define DEF_TIM_AF__PA7__TCH_TIM8_CH1N D(4, 8) +#define DEF_TIM_AF__PA14__TCH_TIM8_CH2 D(5, 8) + #define DEF_TIM_AF__PA7__TCH_TIM1_CH1N D(6, 1) #define DEF_TIM_AF__PA8__TCH_TIM1_CH1 D(6, 1) #define DEF_TIM_AF__PA9__TCH_TIM1_CH2 D(6, 1) @@ -1339,6 +1341,8 @@ #define DEF_TIM_AF__PB4__TCH_TIM8_CH2N D(4, 8) #define DEF_TIM_AF__PB15__TCH_TIM1_CH3N D(4, 1) +#define DEF_TIM_AF__PB6__TCH_TIM8_CH1 D(5, 8) + #define DEF_TIM_AF__PB0__TCH_TIM1_CH2N D(6, 1) #define DEF_TIM_AF__PB0__TCH_TIM1_CH3N D(6, 1) #define DEF_TIM_AF__PB13__TCH_TIM1_CH1N D(6, 1) diff --git a/src/main/drivers/timer_stm32g4xx.c b/src/main/drivers/timer_stm32g4xx.c index dd30fe16e4..be7df6687a 100644 --- a/src/main/drivers/timer_stm32g4xx.c +++ b/src/main/drivers/timer_stm32g4xx.c @@ -74,6 +74,8 @@ const timerHardware_t fullTimerHardware[FULL_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM8, CH1N, PA7, TIM_USE_ANY, 0, 0, 0), + DEF_TIM(TIM8, CH2, PA14, TIM_USE_ANY, 0, 0, 0), + DEF_TIM(TIM1, CH1N, PA7, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM1, CH1, PA8, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM1, CH2, PA9, TIM_USE_ANY, 0, 0, 0), @@ -124,6 +126,8 @@ const timerHardware_t fullTimerHardware[FULL_TIMER_CHANNEL_COUNT] = { DEF_TIM(TIM8, CH1N, PB3, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM8, CH2N, PB4, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM1, CH3N, PB15, TIM_USE_ANY, 0, 0, 0), + + DEF_TIM(TIM8, CH1, PB6, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM1, CH2N, PB0, TIM_USE_ANY, 0, 0, 0), DEF_TIM(TIM1, CH3N, PB0, TIM_USE_ANY, 0, 0, 0),