raiden00pl commented on code in PR #17007: URL: https://github.com/apache/nuttx/pull/17007#discussion_r2354480970
########## arch/arm/src/stm32h5/stm32_adc.c: ########## @@ -624,6 +650,75 @@ static void adc_wdog_enable(struct stm32_dev_s *priv) adc_putreg(priv, STM32_ADC_IER_OFFSET, regval); } +/**************************************************************************** + * Name: adc_wdog1_init + * + * Description: + * Initialize the ADC Watchdog 1 according to Kconfig options. + ****************************************************************************/ + +static void adc_wdog1_init(struct stm32_dev_s *priv) +{ + uint32_t regval; + uint16_t low_thresh = 0; + uint16_t high_thresh = 4095; + uint8_t flt = 0; + bool sgl = false; + uint8_t chan = 0; + bool enable = false; + + /* Initialize Analog Watchdogs if enabled */ +#ifdef CONFIG_STM32H5_ADC1_WDG1 + if (priv->intf == 1) Review Comment: this should go to `stm32_dev_s` and be assigned at the compile time. Here is example how its done for timer and break configuration: https://github.com/apache/nuttx/blob/34ca49b6f50d92d9a8ed87e40decb6b8a42f712b/arch/arm/src/stm32/stm32_pwm.c#L338-L350 https://github.com/apache/nuttx/blob/34ca49b6f50d92d9a8ed87e40decb6b8a42f712b/arch/arm/src/stm32/stm32_pwm.c#L359-L361 https://github.com/apache/nuttx/blob/34ca49b6f50d92d9a8ed87e40decb6b8a42f712b/arch/arm/src/stm32/stm32_pwm.c#L565-L578 https://github.com/apache/nuttx/blob/34ca49b6f50d92d9a8ed87e40decb6b8a42f712b/arch/arm/src/stm32/stm32_pwm.c#L3196-L3228 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org