summaryrefslogtreecommitdiffstats
path: root/firmware/debug.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-04-23 13:41:18 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-04-23 13:41:18 +0000
commit350629929d8045e9a703f0acba0d4acd0a018236 (patch)
tree194a14300a1511107cc75bcb990abd774f01f128 /firmware/debug.c
parent7fa8c949ada6c1fbe67196d96a1a15148a4ebdac (diff)
downloadrockbox-350629929d8045e9a703f0acba0d4acd0a018236.tar.gz
rockbox-350629929d8045e9a703f0acba0d4acd0a018236.tar.bz2
rockbox-350629929d8045e9a703f0acba0d4acd0a018236.zip
Better handling of gdb CTRL-C during debug output
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@199 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/debug.c')
-rw-r--r--firmware/debug.c15
1 files 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 */