From 4e672d9fd7f4b5e25e28122bd4d5db376e36f3a2 Mon Sep 17 00:00:00 2001 From: Jacob Dahl Date: Tue, 29 Oct 2024 15:29:46 -0800 Subject: [PATCH] fix f1 build target --- .../px4/stm/stm32_common/io_pins/io_timer.c | 23 ++++++++++++------- .../stm32f1/include/px4_arch/hw_description.h | 17 -------------- .../stm32f4/include/px4_arch/hw_description.h | 17 -------------- 3 files changed, 15 insertions(+), 42 deletions(-) diff --git a/platforms/nuttx/src/px4/stm/stm32_common/io_pins/io_timer.c b/platforms/nuttx/src/px4/stm/stm32_common/io_pins/io_timer.c index 828ecaa01bee..bb685f0ace45 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/io_pins/io_timer.c +++ b/platforms/nuttx/src/px4/stm/stm32_common/io_pins/io_timer.c @@ -73,8 +73,15 @@ static int io_timer_handler7(int irq, void *context, void *arg); #if defined(HAVE_GTIM_CCXNP) #define HW_GTIM_CCER_CC1NP GTIM_CCER_CC1NP +#define HW_GTIM_CCER_CC2NP GTIM_CCER_CC2NP +#define HW_GTIM_CCER_CC3NP GTIM_CCER_CC3NP +#define HW_GTIM_CCER_CC4NP GTIM_CCER_CC4NP + #else # define HW_GTIM_CCER_CC1NP 0 +# define HW_GTIM_CCER_CC2NP 0 +# define HW_GTIM_CCER_CC3NP 0 +# define HW_GTIM_CCER_CC4NP 0 #endif #define arraySize(a) (sizeof((a))/sizeof(((a)[0]))) @@ -635,31 +642,31 @@ int io_timer_set_dshot_capture_mode(uint8_t timer, uint8_t timer_channel_index, switch (timer_channel_index) { case 0: rEGR(timer) |= ATIM_EGR_UG | GTIM_EGR_CC1G; - rCCER(timer) &= ~(GTIM_CCER_CC1E | GTIM_CCER_CC1P | GTIM_CCER_CC1NP); + rCCER(timer) &= ~(GTIM_CCER_CC1E | GTIM_CCER_CC1P | HW_GTIM_CCER_CC1NP); rCCMR1(timer) |= (GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR1_CC1S_SHIFT); - rCCER(timer) |= (GTIM_CCER_CC1E | GTIM_CCER_CC1P | GTIM_CCER_CC1NP); + rCCER(timer) |= (GTIM_CCER_CC1E | GTIM_CCER_CC1P | HW_GTIM_CCER_CC1NP); break; case 1: rEGR(timer) |= ATIM_EGR_UG | GTIM_EGR_CC2G; - rCCER(timer) &= ~(GTIM_CCER_CC2E | GTIM_CCER_CC2P | GTIM_CCER_CC2NP); + rCCER(timer) &= ~(GTIM_CCER_CC2E | GTIM_CCER_CC2P | HW_GTIM_CCER_CC2NP); rCCMR1(timer) |= (GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR1_CC2S_SHIFT); - rCCER(timer) |= (GTIM_CCER_CC2E | GTIM_CCER_CC2P | GTIM_CCER_CC2NP); + rCCER(timer) |= (GTIM_CCER_CC2E | GTIM_CCER_CC2P | HW_GTIM_CCER_CC2NP); break; case 2: rEGR(timer) |= ATIM_EGR_UG | GTIM_EGR_CC3G; - rCCER(timer) &= ~(GTIM_CCER_CC3E | GTIM_CCER_CC3P | GTIM_CCER_CC3NP); + rCCER(timer) &= ~(GTIM_CCER_CC3E | GTIM_CCER_CC3P | HW_GTIM_CCER_CC3NP); rCCMR2(timer) |= (GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR2_CC3S_SHIFT); - rCCER(timer) |= (GTIM_CCER_CC3E | GTIM_CCER_CC3P | GTIM_CCER_CC3NP); + rCCER(timer) |= (GTIM_CCER_CC3E | GTIM_CCER_CC3P | HW_GTIM_CCER_CC3NP); break; case 3: rEGR(timer) |= ATIM_EGR_UG | GTIM_EGR_CC4G; - rCCER(timer) &= ~(GTIM_CCER_CC4E | GTIM_CCER_CC4P | GTIM_CCER_CC4NP); + rCCER(timer) &= ~(GTIM_CCER_CC4E | GTIM_CCER_CC4P | HW_GTIM_CCER_CC4NP); rCCMR2(timer) |= (GTIM_CCMR_CCS_CCIN1 << GTIM_CCMR2_CC4S_SHIFT); - rCCER(timer) |= (GTIM_CCER_CC4E | GTIM_CCER_CC4P | GTIM_CCER_CC4NP); + rCCER(timer) |= (GTIM_CCER_CC4E | GTIM_CCER_CC4P | HW_GTIM_CCER_CC4NP); break; } diff --git a/platforms/nuttx/src/px4/stm/stm32f1/include/px4_arch/hw_description.h b/platforms/nuttx/src/px4/stm/stm32f1/include/px4_arch/hw_description.h index 2097d0f5ade0..86badcfe655f 100644 --- a/platforms/nuttx/src/px4/stm/stm32f1/include/px4_arch/hw_description.h +++ b/platforms/nuttx/src/px4/stm/stm32f1/include/px4_arch/hw_description.h @@ -38,23 +38,6 @@ static inline constexpr void getTimerChannelDMAMap(Timer::Timer timer, const DMA &dma, uint32_t *dma_map_ch) { // Not supported - switch (timer) { - case Timer::Timer1: - case Timer::Timer2: - case Timer::Timer3: - case Timer::Timer4: - case Timer::Timer5: - case Timer::Timer6: - case Timer::Timer7: - case Timer::Timer8: - case Timer::Timer9: - case Timer::Timer10: - case Timer::Timer11: - case Timer::Timer12: - case Timer::Timer13: - case Timer::Timer14: - break; - } } static inline constexpr uint32_t getTimerUpdateDMAMap(Timer::Timer timer, const DMA &dma) diff --git a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/hw_description.h b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/hw_description.h index 10f416a702cd..1dd3bfd92d31 100644 --- a/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/hw_description.h +++ b/platforms/nuttx/src/px4/stm/stm32f4/include/px4_arch/hw_description.h @@ -38,23 +38,6 @@ static inline constexpr void getTimerChannelDMAMap(Timer::Timer timer, const DMA &dma, uint32_t *dma_map_ch) { // Not supported - switch (timer) { - case Timer::Timer1: - case Timer::Timer2: - case Timer::Timer3: - case Timer::Timer4: - case Timer::Timer5: - case Timer::Timer6: - case Timer::Timer7: - case Timer::Timer8: - case Timer::Timer9: - case Timer::Timer10: - case Timer::Timer11: - case Timer::Timer12: - case Timer::Timer13: - case Timer::Timer14: - break; - } } static inline constexpr uint32_t getTimerUpdateDMAMap(Timer::Timer timer, const DMA &dma)