jwang12340 commented on code in PR #18039:
URL: https://github.com/apache/nuttx/pull/18039#discussion_r2752965769


##########
drivers/can/ctucanfd_pci.c:
##########
@@ -800,6 +803,70 @@ static int ctucanfd_chrdev_txconfirm(struct can_dev_s 
*dev, int idx)
 }
 #endif
 
+/*****************************************************************************
+ * Name: ctucanfd_chrdev_cancel
+ *
+ * Description:
+ *   Cancel one can message.
+ *
+ * Input Parameters:
+ *   dev - An instance of the "upper half" can driver state structure.
+ *   msg - One can message.
+ *
+ * Returned Value:
+ *   true on success; zero on failure.
+ *****************************************************************************/
+
+static bool ctucanfd_chrdev_cancel(FAR struct can_dev_s *dev,
+                                   FAR struct can_msg_s *msg)
+{
+  FAR struct ctucanfd_can_s *priv = (FAR struct ctucanfd_can_s *)dev;
+  uint32_t regval;
+  uint32_t offset;
+  uint32_t id;
+  int i;
+
+  /* Find TXB to be canceled */
+
+  for (i = 0; i < CTUCANFD_TXBUF_CNT; i++)
+    {
+      offset = CTUCANFD_TXT1 + CTUCANFD_TXT_SIZE * i;
+      id = ctucanfd_getreg(priv, offset + CTUCANFD_TXBUF_ID);

Review Comment:
   Thanks for the advice, add a new commit to updated it



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