Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/9910


Change subject: UART: make IRQ/ISR enabling simpler
......................................................................

UART: make IRQ/ISR enabling simpler

Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b
---
M firmware/libboard/common/source/uart_console.c
1 file changed, 4 insertions(+), 8 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/10/9910/1

diff --git a/firmware/libboard/common/source/uart_console.c 
b/firmware/libboard/common/source/uart_console.c
index fe64922..9004197 100644
--- a/firmware/libboard/common/source/uart_console.c
+++ b/firmware/libboard/common/source/uart_console.c
@@ -150,16 +150,12 @@
     }
 
     /* Only store input if buffer is not full, else drop it */
-    bool trigger_isr = false;
-    if (rbuf_is_empty(&uart_tx_buffer)) {
-        trigger_isr = true;
-    }
     if (!rbuf_is_full(&uart_tx_buffer)) {
         rbuf_write(&uart_tx_buffer, c);
-    }
-    if (trigger_isr) {
-        pUart->UART_IER = UART_IER_TXRDY;
-        CONSOLE_ISR();
+        if (!(pUart->UART_IMR & UART_IMR_TXRDY)) {
+            pUart->UART_IER = UART_IER_TXRDY;
+            CONSOLE_ISR();
+        }
     }
 }
 

--
To view, visit https://gerrit.osmocom.org/9910
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b
Gerrit-Change-Number: 9910
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kre...@sysmocom.de>

Reply via email to