aboutsummaryrefslogtreecommitdiff
path: root/Debugger/debug_comm.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-02-14 11:46:47 +0800
committerTat-Chee Wan (USM)2011-02-14 11:46:47 +0800
commitc5db8aa5365ceb01f81f9c760aa57d512b4669b9 (patch)
tree28f0399dbdf1df802811d92af24dc307dc2e55ab /Debugger/debug_comm.S
parent447d92e66be8c481db8e066da20fd8186ef78083 (diff)
initial nxt firmware support hooks
Diffstat (limited to 'Debugger/debug_comm.S')
-rw-r--r--Debugger/debug_comm.S26
1 files changed, 26 insertions, 0 deletions
diff --git a/Debugger/debug_comm.S b/Debugger/debug_comm.S
index 77b2175..eee38a5 100644
--- a/Debugger/debug_comm.S
+++ b/Debugger/debug_comm.S
@@ -45,6 +45,11 @@ debug_msgTxBuf_AppendPtr:
debug_segmentRxNum: /* Current Rx Segment Number */
.word 0x0
+#ifndef __NXOS__
+debug_nxtMsgLength: /* NXT Firmware Received USB Message Length */
+ .word 0x0
+#endif
+
.data
.align 4
@@ -391,7 +396,28 @@ _dbg__usbbuf_reset:
ldmfd sp!, {pc}
#else
/* FIXME: NXT Firmware support */
+ ldr r1, =debug_nxtMsgLength
+ mov r0, #0
+ str r0, [r1] /* Clear NXT USB Received Message Length */
bx lr
+
+ .global dbg__copyNxtDebugMsg
+/* dbg__copyNxtDebugMsg
+ * Copy NXT Firmware Debug Message to our own Buffers, indicate Msg Received status.
+ * On Entry:
+ * R0: NXT USB Input Buf Pointer
+ * R1: USB Command Bit
+ * R2: USB Raw Message Length
+ * On Exit:
+ * R0-R3: Destroyed
+ */
+
+dbg__copyNxtDebugMsg:
+ ldr r1, =debug_nxtMsgLength
+ str r2, [r1]
+ ldr r1, =debug_InUSBBuf
+ _dbg_memcpy r1, r0, r2, r3 /* r3: scratch register */
+ bx lr
#endif
/* _dbg_reset_msgTxBuf_AppendPtr