[PATCH] bsps/microblaze: Fix uart interrupt conditional code

Alex White alex.white at oarcorp.com
Mon Oct 25 02:32:12 UTC 2021


This includes bspopts.h so that the #define is not lost. This also adds
a macro that was missing when console interrupts were enabled.
---
 bsps/microblaze/include/dev/serial/uartlite.h |  1 +
 .../include/dev/serial/uartlite_l.h           | 20 +++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/bsps/microblaze/include/dev/serial/uartlite.h b/bsps/microblaze/include/dev/serial/uartlite.h
index 6e288d4dc7..c77b3286a6 100644
--- a/bsps/microblaze/include/dev/serial/uartlite.h
+++ b/bsps/microblaze/include/dev/serial/uartlite.h
@@ -38,6 +38,7 @@
 
 #include <rtems/termiostypes.h>
 
+#include <bspopts.h>
 #include <dev/serial/uartlite_l.h>
 
 #ifdef __cplusplus
diff --git a/bsps/microblaze/include/dev/serial/uartlite_l.h b/bsps/microblaze/include/dev/serial/uartlite_l.h
index 8c0598e191..96271d73ca 100644
--- a/bsps/microblaze/include/dev/serial/uartlite_l.h
+++ b/bsps/microblaze/include/dev/serial/uartlite_l.h
@@ -253,6 +253,26 @@ static inline void Xil_Out32(UINTPTR Addr, u32 Value)
 	  XUL_SR_TX_FIFO_FULL)
 
 
+#ifdef __rtems__
+/****************************************************************************/
+/**
+*
+* Check to see if the transmitter is empty.
+*
+* @param	BaseAddress is the  base address of the device
+*
+* @return	TRUE if the transmitter is empty, FALSE otherwise.
+*
+* @note		C-style Signature:
+* 		int XUartLite_IsTransmitEmpty(u32 BaseAddress);
+*
+*****************************************************************************/
+#define XUartLite_IsTransmitEmpty(BaseAddress) \
+	((XUartLite_GetStatusReg((BaseAddress)) & XUL_SR_TX_FIFO_EMPTY) == \
+	  XUL_SR_TX_FIFO_EMPTY)
+#endif
+
+
 /****************************************************************************/
 /**
 *
-- 
2.27.0



More information about the devel mailing list