commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r10102 - gnuradio/trunk/usrp2/firmware/lib


From: matt
Subject: [Commit-gnuradio] r10102 - gnuradio/trunk/usrp2/firmware/lib
Date: Thu, 4 Dec 2008 17:03:30 -0700 (MST)

Author: matt
Date: 2008-12-04 17:03:29 -0700 (Thu, 04 Dec 2008)
New Revision: 10102

Modified:
   gnuradio/trunk/usrp2/firmware/lib/hal_uart.c
   gnuradio/trunk/usrp2/firmware/lib/hal_uart.h
Log:
send a char to the serial port, but don't wait if the queue is full


Modified: gnuradio/trunk/usrp2/firmware/lib/hal_uart.c
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/hal_uart.c        2008-12-04 06:12:51 UTC 
(rev 10101)
+++ gnuradio/trunk/usrp2/firmware/lib/hal_uart.c        2008-12-05 00:03:29 UTC 
(rev 10102)
@@ -57,6 +57,16 @@
   u->txchar = ch;
 }
 
+void
+hal_uart_putc_nowait(int ch)
+{
+  if (ch == '\n')              // FIXME for now map \n -> \r\n
+    hal_uart_putc('\r');
+
+  if(u->txlevel)   // If fifo has space
+    u->txchar = ch;
+}
+
 int
 hal_uart_getc(void)
 {

Modified: gnuradio/trunk/usrp2/firmware/lib/hal_uart.h
===================================================================
--- gnuradio/trunk/usrp2/firmware/lib/hal_uart.h        2008-12-04 06:12:51 UTC 
(rev 10101)
+++ gnuradio/trunk/usrp2/firmware/lib/hal_uart.h        2008-12-05 00:03:29 UTC 
(rev 10102)
@@ -54,6 +54,11 @@
  */
 void hal_uart_putc(int ch);
 
+/*!
+ * \brief Enqueue \p ch for output over serial port, silent fail if queue is 
full
+ */
+void hal_uart_putc_nowait(int ch);
+
 /*
  * \brief Blocking read of next char from serial port
  */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]