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


##########
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:
   Since it is always assigned, maybe it could be better to transform this 
check in a DEBUGASSERT()



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