aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/src/os/dbgu.c
diff options
context:
space:
mode:
authorMin Xu <min.xu@min-info.net>2014-10-25 22:04:30 +0200
committerHarald Welte <laforge@gnumonks.org>2014-11-11 22:30:55 +0100
commit478c2332b74c3ee7dfd8d70873419cf0ef19619e (patch)
treecc17de873e6cffeec5d5b4ab38bc59381722527f /firmware/src/os/dbgu.c
parent8701086cacca088ae34580908cec45f77042b94e (diff)
Allow some USB interrupts to be handled during dbgu_append
Diffstat (limited to 'firmware/src/os/dbgu.c')
-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;