From 94512571a5efcc4ff1f246d4bceb28fc73fee843 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 11 Nov 2024 13:58:24 -0500 Subject: [PATCH] flexibility for SENT --- .../ports/stm32/mcuconf_common_f4_f7.h | 27 +++++++++++++++++++ firmware/hw_layer/ports/stm32/stm32_icu.cpp | 3 +-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h b/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h index c5b7967301..9c0fe31a65 100644 --- a/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h +++ b/firmware/hw_layer/ports/stm32/mcuconf_common_f4_f7.h @@ -190,13 +190,34 @@ /* * ICU driver system settings. */ +#ifndef STM32_ICU_USE_TIM1 #define STM32_ICU_USE_TIM1 FALSE +#endif + +#ifndef STM32_ICU_USE_TIM2 #define STM32_ICU_USE_TIM2 TRUE +#endif + +#ifndef STM32_ICU_USE_TIM3 #define STM32_ICU_USE_TIM3 FALSE +#endif + +#ifndef STM32_ICU_USE_TIM4 #define STM32_ICU_USE_TIM4 FALSE +#endif + +#ifndef STM32_ICU_USE_TIM5 #define STM32_ICU_USE_TIM5 FALSE +#endif + +#ifndef STM32_ICU_USE_TIM8 #define STM32_ICU_USE_TIM8 FALSE +#endif + +#ifndef STM32_ICU_USE_TIM9 #define STM32_ICU_USE_TIM9 FALSE +#endif + #define STM32_ICU_TIM1_IRQ_PRIORITY ICU_PRIORITY #define STM32_ICU_TIM2_IRQ_PRIORITY ICU_PRIORITY #define STM32_ICU_TIM3_IRQ_PRIORITY ICU_PRIORITY @@ -220,8 +241,14 @@ * PWM driver system settings. */ #define STM32_PWM_USE_ADVANCED FALSE + +#ifndef STM32_PWM_USE_TIM1 #define STM32_PWM_USE_TIM1 TRUE +#endif + +#ifndef STM32_PWM_USE_TIM2 #define STM32_PWM_USE_TIM2 FALSE +#endif #ifndef STM32_PWM_USE_TIM3 // Hellen often uses TIM3 for ETB diff --git a/firmware/hw_layer/ports/stm32/stm32_icu.cpp b/firmware/hw_layer/ports/stm32/stm32_icu.cpp index 2ab1cd48e8..1c894c33b4 100644 --- a/firmware/hw_layer/ports/stm32/stm32_icu.cpp +++ b/firmware/hw_layer/ports/stm32/stm32_icu.cpp @@ -119,8 +119,7 @@ * ChibiOS limitation is that only channels #1 and #2 could be used for input capture * Could this be unified with getConfigForPin() method? */ -bool getIcuParams(brain_pin_e hwPin, iomode_t *af_ptr, ICUDriver ** icu_ptr, icuchannel_t *channel_ptr, uint32_t *clock_ptr) -{ +bool getIcuParams(brain_pin_e hwPin, iomode_t *af_ptr, ICUDriver ** icu_ptr, icuchannel_t *channel_ptr, uint32_t *clock_ptr) { switch (hwPin) { case Gpio::A0: RETURN_ICU5(ICU_CHANNEL_1);