aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_comm.S
diff options
context:
space:
mode:
authorTC Wan2010-12-27 18:12:29 +0800
committerTC Wan2010-12-27 18:12:29 +0800
commitb7d4f58fac3aced7756a15264b89575ab0ba2490 (patch)
tree3ade04030bfa6ecd631460245c840c8d11015567 /AT91SAM7S256/armdebug/Debugger/debug_comm.S
parent2ce74d88a2a894799dfb025e92806c61c5dd9612 (diff)
parent86539efe1fe0cbbc6926f23a6e29b97d09ef9360 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_comm.S')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_comm.S20
1 files changed, 9 insertions, 11 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_comm.S b/AT91SAM7S256/armdebug/Debugger/debug_comm.S
index 872ddc6..75ff505 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_comm.S
+++ b/AT91SAM7S256/armdebug/Debugger/debug_comm.S
@@ -14,16 +14,12 @@
*/
-#define __NXOS__ /* Temporarily hardcoded in file */
+/* #define __NXOS__ */ /* Defined externally in SConstruct */
#define __ASSEMBLY__
+#include "debug_macros.h"
#include "debug_stub.h"
-
-#ifdef __NXOS__
-#include "usb.h"
-#else
-#include "c_comm.h"
-#endif
+#include "debug_comm.h"
.bss
.align 4
@@ -346,9 +342,10 @@ dbg__comm_init:
_dbg__usbbuf_reset:
stmfd sp!, {lr}
ldr r0, =debug_InUSBBuf
- ldr r1, #USB_BUFSIZE
+ mov r1, #USB_BUFSIZE
ldr r2, =nx_usb_read
- bl r2
+ mov lr,pc
+ bx r2
ldmfd sp!, {pc}
#else
/* FIXME: NXT Firmware support */
@@ -365,8 +362,9 @@ _dbg__usbbuf_reset:
dbg__hasDebugMsg:
#ifdef __NXOS__
stmfd sp!, {lr}
- ldr r0, =nx_usb_data_read
- bl r2 /* Number of bytes read in R0 */
+ ldr r2, =nx_usb_data_read
+ mov lr,pc
+ bx r2 /* Number of bytes read in R0 */
/* Note: The return value is the USB Buffer Size, includes NXT Direct Command Header */
/* FIXME: Need to check command type etc. before accepting it as a valid Debugger message */
ldr r2, =debug_InUSBBuf