From 599ca3aae30134f9b3345df362172294c05431cf Mon Sep 17 00:00:00 2001 From: raphaelcoeffic Date: Sun, 16 Jul 2023 12:41:05 +0200 Subject: [PATCH] fix(boxer): Flysky gimbal detection --- radio/src/targets/common/arm/stm32/CMakeLists.txt | 4 ++-- radio/src/targets/horus/board.cpp | 6 ++---- radio/src/targets/taranis/board.cpp | 11 +++++++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/radio/src/targets/common/arm/stm32/CMakeLists.txt b/radio/src/targets/common/arm/stm32/CMakeLists.txt index 7b280e11835..7bf033e35be 100644 --- a/radio/src/targets/common/arm/stm32/CMakeLists.txt +++ b/radio/src/targets/common/arm/stm32/CMakeLists.txt @@ -70,8 +70,8 @@ if(AUX_SERIAL OR AUX2_SERIAL) endif() if(FLYSKY_GIMBAL) - set(FIRMWARE_TARGET_SRC ${FIRMWARE_TARGET_SRC} - ../common/arm/stm32/flysky_gimbal_driver.cpp + set(FIRMWARE_SRC ${FIRMWARE_SRC} + targets/common/arm/stm32/flysky_gimbal_driver.cpp ) add_definitions(-DFLYSKY_GIMBAL) endif() diff --git a/radio/src/targets/horus/board.cpp b/radio/src/targets/horus/board.cpp index b371fee9d34..3ce7eeb280c 100644 --- a/radio/src/targets/horus/board.cpp +++ b/radio/src/targets/horus/board.cpp @@ -24,8 +24,6 @@ #include "hal/switch_driver.h" #include "hal/rotary_encoder.h" -#include "sticks_pwm_driver.h" - #include "board.h" #include "boards/generic_stm32/module_ports.h" #include "boards/generic_stm32/intmodule_heartbeat.h" @@ -40,7 +38,7 @@ #include -#if defined(RADIO_FAMILY_T16) || defined(PCBNV14) +#if defined(FLYSKY_GIMBAL) #include "flysky_gimbal_driver.h" #endif @@ -167,7 +165,7 @@ void boardInit() sticksPwmDetect(); #endif -#if defined(RADIO_FAMILY_T16) +#if defined(FLYSKY_GIMBAL) flysky_gimbal_init(); #endif diff --git a/radio/src/targets/taranis/board.cpp b/radio/src/targets/taranis/board.cpp index b700f53aa4a..0314ad7128e 100644 --- a/radio/src/targets/taranis/board.cpp +++ b/radio/src/targets/taranis/board.cpp @@ -31,10 +31,13 @@ #include "debug.h" #include "rtc.h" -#include "../common/arm/stm32/timers_driver.h" - +#include "timers_driver.h" #include "dataconstants.h" +#if defined(FLYSKY_GIMBAL) + #include "flysky_gimbal_driver.h" +#endif + #if !defined(BOOT) #include "opentx.h" #if defined(PXX1) @@ -211,6 +214,10 @@ void boardInit() sticksPwmDetect(); #endif +#if defined(FLYSKY_GIMBAL) + flysky_gimbal_init(); +#endif + if (!adcInit(&_adc_driver)) TRACE("adcInit failed");