michallenc commented on code in PR #20149:
URL: https://github.com/apache/nuttx/pull/20149#discussion_r4016559402


##########
arch/arm/src/common/stm32/stm32_comp_m3m4_v2.c:
##########
@@ -918,8 +920,36 @@ static int comp_read(struct comp_dev_s *dev)
 #ifdef CONFIG_COMP
 static int comp_ioctl(struct comp_dev_s *dev, int cmd, unsigned long arg)
 {
-#warning "Missing logic"
-  return -ENOTTY;
+  FAR struct stm32_comp_s *priv = (FAR struct stm32_comp_s *)dev->ad_priv;
+  int ret = OK;
+
+  switch (cmd)
+    {
+      case ANIOC_COMP_ENABLE:
+        {
+          /* Enable comparator */
+
+          comp_enable(priv, true);

Review Comment:
   What about `comp_lock_set` or returning error value when `comp_enable` fails 
if the comparator is already set and locked?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to