From 350629929d8045e9a703f0acba0d4acd0a018236 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Tue, 23 Apr 2002 13:41:18 +0000 Subject: [PATCH] Better handling of gdb CTRL-C during debug output git-svn-id: svn://svn.rockbox.org/rockbox/trunk@199 a1c6a512-1295-4272-9138-f99709370657 --- firmware/debug.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/firmware/debug.c b/firmware/debug.c index d78fa17528..7bc0f3eb00 100644 --- a/firmware/debug.c +++ b/firmware/debug.c @@ -63,10 +63,6 @@ static char debug_rx_char(void) char ch; char ssr; - /* Special debug hack. Shut off the IRQ while polling, to prevent the debug - stub from catching the IRQ */ - SCR1 &= ~0x40; - while (!debug_rx_ready()) { ; @@ -80,8 +76,6 @@ static char debug_rx_char(void) if (ssr) debug_handle_error (ssr); - /* Special debug hack. Enable the IRQ again */ - SCR1 |= 0x40; return ch; } @@ -100,8 +94,14 @@ static char lowhex(int x) static void putpacket (char *buffer) { register int checksum; + char ch; char *src = buffer; + + /* Special debug hack. Shut off the Rx IRQ during I/O to prevent the debug + stub from interrupting the message */ + SCR1 &= ~0x40; + debug_tx_char ('$'); checksum = 0; @@ -144,6 +144,9 @@ static void putpacket (char *buffer) /* Wait for the '+' */ debug_rx_char(); + + /* Special debug hack. Enable the IRQ again */ + SCR1 |= 0x40; } /* convert the memory, pointed to by mem into hex, placing result in buf */