acassis commented on code in PR #16530:
URL: https://github.com/apache/nuttx/pull/16530#discussion_r2144994627


##########
arch/arm/src/stm32f0l0g0/stm32_adc.c:
##########
@@ -769,7 +762,316 @@ static void adc_timstart(struct stm32_dev_s *priv, bool 
enable)
 #ifdef ADC_HAVE_TIMER
 static int adc_timinit(struct stm32_dev_s *priv)
 {
-#warning TODO: adc_timinit
+  uint32_t prescaler;
+  uint32_t reload;
+  uint32_t timclk;
+  uint16_t clrbits = 0;
+  uint16_t setbits = 0;
+  uint16_t cr2;
+  uint16_t ccmr1;
+  uint16_t ccmr2;
+  uint16_t ocmode1;
+  uint16_t ocmode2;
+  uint16_t ccenable;
+  uint16_t ccer;
+  uint16_t egr;
+
+  /* If the timer base address is zero, then this ADC was not configured to
+   * use a timer.
+   */
+
+  if (priv->tbase == 0)
+    {
+      return ERROR;

Review Comment:
   @raiden00pl is it possible to include an aerr("ERROR: ADC is not configured 
to use a timer!\n") ?
   I saw it was not defined for others stm32 families, but this error message 
will give some hint to users trying to use ADC with timer.



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