xiaoxiang781216 commented on code in PR #21643:
URL: https://github.com/apache/nuttx/pull/21643#discussion_r4546219822


##########
drivers/misc/lwl_console.c:
##########
@@ -296,25 +977,40 @@ static ssize_t lwlconsole_write(FAR struct file *filep,
 
 /****************************************************************************
  * Name: up_putc
+ *
+ * Description:
+ *   Low-level, unbuffered console output used by syslog and by the assert
+ *   logic.  It waits for room in the link.
+ *
  ****************************************************************************/
 
 void up_putc(int ch)
 {
-  /* If link not initialize just return */
+  irqstate_t flags;
+  uint8_t c = ch;
+
+  flags = enter_critical_section();
 
-  if (!linkactive())
+  do
     {
-      return;
+      while (!lwl_txready(&g_lwl_dev))
+        {
+        }
     }
+  while (lwl_sendbuf(&g_lwl_dev, &c, 1) == 0);
 
-  write8bits(LWL_PORT_CONSOLE, (uint8_t)ch);
+  leave_critical_section(flags);

Review Comment:
   here is the patch: https://github.com/apache/nuttx/pull/21746



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