Skip to content

Commit

Permalink
Fixed V16 encoder problem after switching models.
Browse files Browse the repository at this point in the history
  • Loading branch information
richardclli committed Dec 3, 2024
1 parent 0ea41f2 commit 5467456
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions radio/src/targets/horus/hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1126,18 +1126,14 @@
#endif

// Heartbeat
#define INTMODULE_HEARTBEAT
#if defined(RADIO_V16)
#define INTMODULE_HEARTBEAT_GPIO GPIO_PIN(GPIOB, 11) // PB.11 / TIM2_CH4
#define INTMODULE_HEARTBEAT_EXTI_PORT LL_SYSCFG_EXTI_PORTB
#define INTMODULE_HEARTBEAT_EXTI_SYS_LINE LL_SYSCFG_EXTI_LINE11
#define INTMODULE_HEARTBEAT_EXTI_LINE LL_EXTI_LINE_11
#else
#if !defined(RADIO_V16)
#define INTMODULE_HEARTBEAT
#define INTMODULE_HEARTBEAT_GPIO GPIO_PIN(GPIOD, 12) // PD.12 / TIM4_CH1
#define INTMODULE_HEARTBEAT_EXTI_PORT LL_SYSCFG_EXTI_PORTH
#define INTMODULE_HEARTBEAT_EXTI_SYS_LINE LL_SYSCFG_EXTI_LINE12
#define INTMODULE_HEARTBEAT_EXTI_LINE LL_EXTI_LINE_12
#endif

// INTMODULE_HEARTBEAT_EXTI IRQ
#if !defined(USE_EXTI15_10_IRQ)
#define USE_EXTI15_10_IRQ
Expand Down Expand Up @@ -1168,13 +1164,15 @@
#define TRAINER_TIMER_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)

// Trainer CPPM input on heartbeat pin
#define TRAINER_MODULE_CPPM_TIMER TIM4
#define TRAINER_MODULE_CPPM_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)
#define TRAINER_MODULE_CPPM_GPIO INTMODULE_HEARTBEAT_GPIO
#define TRAINER_MODULE_CPPM_TIMER_Channel LL_TIM_CHANNEL_CH1
#define TRAINER_MODULE_CPPM_TIMER_IRQn TIM4_IRQn
#define TRAINER_MODULE_CPPM_TIMER_IRQHandler TIM4_IRQHandler
#define TRAINER_MODULE_CPPM_GPIO_AF LL_GPIO_AF_2
#if !defined(RADIO_V16)
#define TRAINER_MODULE_CPPM_TIMER TIM4
#define TRAINER_MODULE_CPPM_FREQ (PERI1_FREQUENCY * TIMER_MULT_APB1)
#define TRAINER_MODULE_CPPM_GPIO INTMODULE_HEARTBEAT_GPIO
#define TRAINER_MODULE_CPPM_TIMER_Channel LL_TIM_CHANNEL_CH1
#define TRAINER_MODULE_CPPM_TIMER_IRQn TIM4_IRQn
#define TRAINER_MODULE_CPPM_TIMER_IRQHandler TIM4_IRQHandler
#define TRAINER_MODULE_CPPM_GPIO_AF LL_GPIO_AF_2
#endif

// Millisecond timer
#define MS_TIMER TIM14
Expand Down

0 comments on commit 5467456

Please sign in to comment.