raiden00pl commented on code in PR #16500:
URL: https://github.com/apache/nuttx/pull/16500#discussion_r2144760515


##########
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##########
@@ -1132,6 +1155,19 @@ static void adc_common_cfg(struct stm32_dev_s *priv)
   uint32_t clrbits = 0;
   uint32_t setbits = 0;
 
+#if defined(CONFIG_STM32F0L0G0_STM32G0)
+
+  clrbits |= ADC_CCR_PRESC_MASK | ADC_CCR_VREFEN |
+             ADC_CCR_TSEN | ADC_CCR_VBATEN;
+
+#  ifdef STM32_ADC_CCR_PRESC
+  setbits |= STM32_ADC_CCR_PRESC;
+#  else
+  setbits |= ADC_CCR_PRESC_DIV4;

Review Comment:
   why set some arbitrary prescaler value here? if user board needs prescaler 
then STM32_ADC_CCR_PRESC is for this. This whole section under `#if 
defined(CONFIG_STM32F0L0G0_STM32G0)` should be generalized and we shouldn't use 
chip specific ifdefs. You can use the same `clrbits` also for other chips



-- 
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

Reply via email to