arm/stm32h7: update makefile for capture & config name

Add capture source files to the makefile pipeline.
STM32H7_CAP to STM32H7_TIMX_CAP for clarity.

Signed-off-by: Côme VINCENT <44554692+comejv@users.noreply.github.com>
This commit is contained in:
Côme VINCENT 2025-08-13 18:03:36 -04:00 committed by Xiang Xiao
parent bebcfa0f46
commit 5cc01bb562
4 changed files with 34 additions and 10 deletions

View file

@ -32,7 +32,6 @@ list(
stm32_start.c
stm32_rcc.c
stm32_lowputc.c
stm32_capture.c
stm32_serial.c
stm32_uid.c)
@ -143,6 +142,10 @@ if(CONFIG_TIMER)
list(APPEND SRCS stm32_tim_lowerhalf.c)
endif()
if(CONFIG_STM32H7_TIMX_CAP)
list(APPEND SRCS stm32_capture.c)
endif()
if(CONFIG_CAPTURE)
list(APPEND SRCS stm32_capture_lowerhalf.c)
endif()

View file

@ -4584,9 +4584,14 @@ config STM32H7_ADC3_TIMTRIG
---help---
Values 0:CC1 1:CC2 2:CC3 3:CC4 4:TRGO
config STM32H7_TIMX_CAP
default n
bool "Helpers for Capture Drivers"
config STM32H7_TIM1_CAP
bool "TIM1 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM1
---help---
Reserve timer 1 for use by the capture driver.
@ -4611,6 +4616,7 @@ endif # STM32H7_TIM1_CAP
config STM32H7_TIM8_CAP
bool "TIM8 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM8
---help---
Reserve timer 8 for use by the capture driver.
@ -4639,6 +4645,7 @@ endif # STM32H7_TIM8_CAP
config STM32H7_TIM2_CAP
bool "TIM2 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM2
---help---
Reserve timer 2 for use by the capture driver.
@ -4663,6 +4670,7 @@ endif # STM32H7_TIM2_CAP
config STM32H7_TIM3_CAP
bool "TIM3 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM3
---help---
Reserve timer 3 for use by the capture driver.
@ -4687,6 +4695,7 @@ endif # STM32H7_TIM3_CAP
config STM32H7_TIM4_CAP
bool "TIM4 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM4
---help---
Reserve timer 4 for use by the capture driver.
@ -4711,6 +4720,7 @@ endif # STM32H7_TIM4_CAP
config STM32H7_TIM5_CAP
bool "TIM5 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM5
---help---
Reserve timer 5 for use by the capture driver.
@ -4739,6 +4749,7 @@ endif # STM32H7_TIM5_CAP
config STM32H7_TIM12_CAP
bool "TIM12 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM12
---help---
Reserve timer 12 for use by the capture driver.
@ -4763,6 +4774,7 @@ endif # STM32H7_TIM12_CAP
config STM32H7_TIM15_CAP
bool "TIM15 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM15
---help---
Reserve timer 15 for use by the capture driver.
@ -4791,6 +4803,7 @@ endif # STM32H7_TIM15_CAP
config STM32H7_TIM13_CAP
bool "TIM13 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM13
---help---
Reserve timer 13 for use by the capture driver.
@ -4815,6 +4828,7 @@ endif # STM32H7_TIM13_CAP
config STM32H7_TIM14_CAP
bool "TIM14 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM14
---help---
Reserve timer 14 for use by the capture driver.
@ -4839,6 +4853,7 @@ endif # STM32H7_TIM14_CAP
config STM32H7_TIM16_CAP
bool "TIM16 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM16
---help---
Reserve timer 16 for use by the capture driver.
@ -4863,6 +4878,7 @@ endif # STM32H7_TIM16_CAP
config STM32H7_TIM17_CAP
bool "TIM17 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_TIM17
---help---
Reserve timer 17 for use by the capture driver.
@ -4891,6 +4907,7 @@ endif # STM32H7_TIM17_CAP
config STM32H7_LPTIM1_CAP
bool "LPTIM1 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_LPTIM1
---help---
Reserve low-power timer 1 for use by the capture driver.
@ -4915,6 +4932,7 @@ endif # STM32H7_LPTIM1_CAP
config STM32H7_LPTIM2_CAP
bool "LPTIM2 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_LPTIM2
---help---
Reserve low-power timer 2 for use by the capture driver.
@ -4939,6 +4957,7 @@ endif # STM32H7_LPTIM2_CAP
config STM32H7_LPTIM3_CAP
bool "LPTIM3 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_LPTIM3
---help---
Reserve low-power timer 3 for use by the capture driver.
@ -4963,6 +4982,7 @@ endif # STM32H7_LPTIM3_CAP
config STM32H7_LPTIM4_CAP
bool "LPTIM4 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_LPTIM4
---help---
Reserve low-power timer 4 for use by the capture driver.
@ -4987,6 +5007,7 @@ endif # STM32H7_LPTIM4_CAP
config STM32H7_LPTIM5_CAP
bool "LPTIM5 Capture"
default n
select STM32H7_TIMX_CAP
depends on STM32H7_LPTIM5
---help---
Reserve low-power timer 5 for use by the capture driver.

View file

@ -144,6 +144,14 @@ ifeq ($(CONFIG_TIMER),y)
CHIP_CSRCS += stm32_tim_lowerhalf.c
endif
ifeq ($(CONFIG_STM32H7_TIMX_CAP),y)
CHIP_CSRCS += stm32_capture.c
endif
ifeq ($(CONFIG_CAPTURE),y)
CHIP_CSRCS += stm32_capture_lowerhalf.c
endif
ifeq ($(CONFIG_STM32H7_LTDC),y)
CHIP_CSRCS += stm32_ltdc.c
endif

View file

@ -59,15 +59,7 @@
* intended for some other purpose.
*/
#if defined(CONFIG_STM32H7_TIM1_CAP) || defined(CONFIG_STM32H7_TIM2_CAP) || \
defined(CONFIG_STM32H7_TIM3_CAP) || defined(CONFIG_STM32H7_TIM4_CAP) || \
defined(CONFIG_STM32H7_TIM5_CAP) || defined(CONFIG_STM32H7_TIM8_CAP) || \
defined(CONFIG_STM32H7_TIM12_CAP) || defined(CONFIG_STM32H7_TIM13_CAP) || \
defined(CONFIG_STM32H7_TIM14_CAP) || defined(CONFIG_STM32H7_TIM15_CAP) || \
defined(CONFIG_STM32H7_TIM16_CAP) || defined(CONFIG_STM32H7_TIM17_CAP) || \
defined(CONFIG_STM32H7_LPTIM1_CAP) || defined(CONFIG_STM32H7_LPTIM2_CAP) || \
defined(CONFIG_STM32H7_LPTIM3_CAP) || defined(CONFIG_STM32H7_LPTIM4_CAP) || \
defined(CONFIG_STM32H7_LPTIM5_CAP)
#if defined(CONFIG_STM32H7_TIMX_CAP)
/* Check if any channel is enabled.
* This is done to simplify the logic below.