summaryrefslogtreecommitdiff
path: root/Debugger/debug_runlooptasks.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-06-29 11:39:05 +0800
committerTat-Chee Wan (USM)2011-06-29 11:39:05 +0800
commit5ad59e0fa53a9e57e4d06a408ab6051c3d6af701 (patch)
tree51162d881fb2ffa8e57257bde76cc97a5582d841 /Debugger/debug_runlooptasks.S
parent7d044b402b282ab55657e1e1b07535aef8ad7edd (diff)
fix bug in dbg__sendcommmsg where it did not set the return value
correctly Implemented delay in dbg__sendCommMsg to improve reliability
Diffstat (limited to 'Debugger/debug_runlooptasks.S')
-rw-r--r--Debugger/debug_runlooptasks.S11
1 files changed, 9 insertions, 2 deletions
diff --git a/Debugger/debug_runlooptasks.S b/Debugger/debug_runlooptasks.S
index 91c130e..d2557d5 100644
--- a/Debugger/debug_runlooptasks.S
+++ b/Debugger/debug_runlooptasks.S
@@ -172,6 +172,7 @@ _dbg__reboot_wait:
#ifdef __NXOS__
.extern debug_OutCommBuf
+ .extern nx_systick_wait_ms
/****************************************************************************
*
* NxOS Communications Driver Interface Routine
@@ -182,7 +183,8 @@ _dbg__reboot_wait:
* On entry:
* R0: Total Message Buffer length
* On exit:
- R0: Tx Status (TRUE if data sent)
+ * R0: Tx Status (TRUE if data sent)
+ * R1-R3: Destroyed
*/
dbg__sendCommMsg:
stmfd sp!, {r4, lr}
@@ -199,12 +201,17 @@ dbg__sendCommMsg:
mov r1, r4 /* Comm buffer length */
bl nx_usb_write
-1: bl nx_usb_data_written /* R0 = True if data has been sent */
+1: mov r0, #1 /* 1 ms delay */
+ bl nx_systick_wait_ms
+ bl nx_usb_data_written /* R0 = True if data has been sent */
teq r0, #0 /* FALSE == #0;
We can't check for True condition since values
used by C-Compiler & ARMDEBUG are different */
/* FIXME: implement timeout */
beq 1b /* Busy Wait Loop */
+
+ mov r0, #TRUE
+ b exit_dbg__sendCommMsg
dbg__sendCommMsgFailed:
mov r0, #FALSE