Skip to content

Commit

Permalink
fix: peripheral clock handling
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelcoeffic authored and pfeerick committed Dec 9, 2023
1 parent f3557b8 commit eeee419
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 8 deletions.
2 changes: 2 additions & 0 deletions radio/src/targets/common/arm/stm32/stm32_pulse_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "stm32_pulse_driver.h"
#include "stm32_gpio_driver.h"
#include "stm32_timer.h"
#include "stm32_dma.h"

Expand Down Expand Up @@ -87,6 +88,7 @@ int stm32_pulse_init(const stm32_pulse_timer_t* tim, uint32_t freq)
pinInit.Pin = tim->GPIO_Pin;
pinInit.Mode = LL_GPIO_MODE_ALTERNATE;
pinInit.Alternate = tim->GPIO_Alternate;
stm32_gpio_enable_clock(tim->GPIOx);
LL_GPIO_Init(tim->GPIOx, &pinInit);

LL_TIM_InitTypeDef timInit;
Expand Down
1 change: 0 additions & 1 deletion radio/src/targets/horus/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ void boardInit()
SD_RCC_AHB1Periph |
AUDIO_RCC_AHB1Periph |
TELEMETRY_RCC_AHB1Periph |
TRAINER_RCC_AHB1Periph |
BT_RCC_AHB1Periph |
AUDIO_RCC_AHB1Periph |
HAPTIC_RCC_AHB1Periph |
Expand Down
1 change: 0 additions & 1 deletion radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,6 @@
#endif

// Trainer Port
#define TRAINER_RCC_AHB1Periph (RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_DMA1)
#define TRAINER_GPIO GPIOC

#define TRAINER_IN_GPIO_PIN LL_GPIO_PIN_6 // PC.06
Expand Down
1 change: 0 additions & 1 deletion radio/src/targets/nv14/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ void delay_self(int count)
AUDIO_RCC_AHB1Periph |\
MONITOR_RCC_AHB1Periph |\
TELEMETRY_RCC_AHB1Periph |\
TRAINER_RCC_AHB1Periph |\
AUDIO_RCC_AHB1Periph |\
HAPTIC_RCC_AHB1Periph |\
INTMODULE_RCC_AHB1Periph |\
Expand Down
1 change: 0 additions & 1 deletion radio/src/targets/nv14/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@
#define HEARTBEAT_GPIO_PIN GPIO_Pin_12 // PD.12

// Trainer Port
#define TRAINER_RCC_AHB1Periph (RCC_AHB1Periph_GPIOD)
#define TRAINER_GPIO GPIOD

#define TRAINER_IN_GPIO_PIN LL_GPIO_PIN_12 // PD.12
Expand Down
1 change: 0 additions & 1 deletion radio/src/targets/taranis/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ void boardInit()
EXTMODULE_RCC_AHB1Periph |
TELEMETRY_RCC_AHB1Periph |
SPORT_UPDATE_RCC_AHB1Periph |
TRAINER_RCC_AHB1Periph |
BT_RCC_AHB1Periph |
USB_CHARGER_RCC_AHB1Periph,
ENABLE);
Expand Down
3 changes: 0 additions & 3 deletions radio/src/targets/taranis/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,6 @@
// Trainer Port
#if defined(PCBXLITES) || defined(PCBX9LITE)
// on these 2 radios the trainer port already uses DMA1_Stream6, we won't use the DMA
#define TRAINER_RCC_AHB1Periph RCC_AHB1Periph_GPIOD
#define TRAINER_GPIO GPIOD
#define TRAINER_IN_GPIO_PIN LL_GPIO_PIN_13 // PD.13
#define TRAINER_IN_TIMER_Channel LL_TIM_CHANNEL_CH2
Expand All @@ -2138,11 +2137,9 @@
#define TRAINER_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)
#elif defined(PCBXLITE)
#define TRAINER_TIMER TIM4
#define TRAINER_RCC_AHB1Periph 0
#define TRAINER_TIMER_IRQn TIM4_IRQn
#define TRAINER_TIMER_IRQHandler TIM4_IRQHandler
#else
#define TRAINER_RCC_AHB1Periph (RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOC | RCC_AHB1Periph_GPIOD | RCC_AHB1Periph_DMA1)
#define TRAINER_GPIO GPIOC
#define TRAINER_IN_GPIO_PIN LL_GPIO_PIN_8 // PC.08
#define TRAINER_IN_TIMER_Channel LL_TIM_CHANNEL_CH3
Expand Down

0 comments on commit eeee419

Please sign in to comment.