From eac6435dec068a910360640788da01586f33fe66 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 20 Nov 2018 18:28:32 +1100 Subject: [PATCH] HAL_ChibiOS: allow CAP ports to be used as PWM on PH4-mini --- .../AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat index d010e4e4e5..ca3e15820f 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/PH4-mini/hwdef.dat @@ -4,10 +4,27 @@ include ../fmuv5/hwdef.dat +# we shift the system timer to TIM5 to allow +# us to use TIM2 for extra PWM outputs +STM32_ST_USE_TIMER 5 + +# disable the IOMCU UART undef IOMCU_UART undef UART8_TX undef UART8_RX undef AP_FEATURE_SBUS_OUT -# RCInput +# allow the first 3 capture ports to be used as PWM outputs or GPIOs +undef PA5 +undef PB3 +undef PB11 +undef FMU_CAP1 +undef FMU_CAP2 +undef FMU_CAP3 + +PA5 TIM2_CH1 TIM2 PWM(9) GPIO(58) +PB3 TIM2_CH2 TIM2 PWM(10) GPIO(59) +PB11 TIM2_CH4 TIM2 PWM(11) GPIO(60) + +# RCInput on the PPM pin, for all protocols PI5 TIM8_CH1 TIM8 RCININT PULLUP LOW