summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-06-16 15:36:28 +0800
committerTat-Chee Wan (USM)2011-06-16 15:36:28 +0800
commit517c98db287a2f66ef0df365b4a3c054e9c87cba (patch)
tree853276a5a5a934a4775992a57db09e045ae2846c
parent549a1a6ae4e1e5493644d1499d4f35ce77f4a5f4 (diff)
fix condition check in _dbg__sendCommMsg due to c vs. armdebug encoding
True is encoded as #1 by C Compiler, while ARMDEBUG uses #0xFFFFFFFF. Changed logic test to avoid this problem.
-rw-r--r--Debugger/debug_comm.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/Debugger/debug_comm.S b/Debugger/debug_comm.S
index d0ea045..a3600a2 100644
--- a/Debugger/debug_comm.S
+++ b/Debugger/debug_comm.S
@@ -408,9 +408,11 @@ _dbg__sendCommMsg:
mov r4, r0 /* Keep Comm Buffer length in R4 */
#ifdef __NXOS__
/* Check USB bus status, transmit message if possible */
- bl nx_usb_is_connected /* R0 = True if USB is ready */
- cmp r0, #TRUE
- bne _exit_dbg__sendCommMsg
+ bl nx_usb_is_connected /* R0 = TRUE (#1) if USB is ready */
+ teq r0, #0 /* FALSE == #0;
+ We can't check for True condition since values
+ used by C-Compiler & ARMDEBUG are different */
+ beq _dbg__sendCommMsgFailed
/* Actual transmission (blocking) */
ldr r0, =debug_OutCommBuf /* data pointer parameter */