summaryrefslogtreecommitdiff
path: root/firmware/src/os
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/src/os')
-rw-r--r--firmware/src/os/dbgu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/src/os/dbgu.c b/firmware/src/os/dbgu.c
index d8bf8d1..72eaa88 100644
--- a/firmware/src/os/dbgu.c
+++ b/firmware/src/os/dbgu.c
@@ -55,7 +55,6 @@
#define DEBUG_BUFFER_SIZE (1 << 10)
#define DEBUG_BUFFER_MASK (DEBUG_BUFFER_SIZE - 1)
-#define USART_SYS_LEVEL 4
/*---------------------------- Global Variable ------------------------------*/
//*----------------------------------------------------------------------------
@@ -370,6 +369,9 @@ void dbgu_rb_append(char *data, int len)
avail = (dbgu.out_head - 1 - dbgu.in_tail) & DEBUG_BUFFER_MASK;
local_head = (unsigned)len;
if (local_head > avail) {
+ local_irq_restore(intcFlags);
+ while ((AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXBUFE) == 0);
+ local_irq_save(intcFlags);
while ((AT91C_BASE_DBGU->DBGU_CSR & AT91C_US_TXBUFE) == 0);
dbgu.out_head = dbgu.out_tail;
avail = (dbgu.out_head - 1 - dbgu.in_tail) & DEBUG_BUFFER_MASK;
personal git repositories of Harald Welte. Your mileage may vary