aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
diff options
context:
space:
mode:
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S47
1 files changed, 44 insertions, 3 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S b/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
index 75c477c..3bcf35a 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
+++ b/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
@@ -80,6 +80,7 @@
.align 4
.global dbg__runloopTasks
.global dbg__reboot
+ .global dbg__display_abort_info
.global dbg__sendCommMsg
#ifdef __NXOS__
@@ -90,7 +91,10 @@
****************************************************************************/
dbg__runloopTasks:
/* Currently, there's nothing that needs to be done in the NxOS Run Loop */
- bx lr
+ push {lr}
+ mov r0, #1 /* 1 ms delay */
+ bl nx_systick_wait_ms
+ pop {pc}
#else
/****************************************************************************
@@ -113,7 +117,11 @@ dbg__runloopTasks:
*
****************************************************************************/
dbg__reboot:
+#ifdef REBOOT_POWERDOWN
+ b nx_core_halt /* Shutdown Brick, won't return */
+#else
b nx_core_reset /* Reboot Brick, won't return */
+#endif
#else
/****************************************************************************
@@ -161,6 +169,35 @@ _dbg__reboot_wait:
b _dbg__reboot_wait /* Wait for AVR... */
#endif
+#ifdef __NXOS__
+/****************************************************************************
+ *
+ * NxOS Abort Info LCD Display Routine
+ *
+ ****************************************************************************/
+/* On entry:
+ * r0: abort type
+ * On exit:
+ * r0-r3: destroyed
+ */
+dbg__display_abort_info:
+ push {lr}
+ _getdbgregister DBGSTACK_USERPC_INDEX, r1 /* Retrieve User PC into R2 */
+ _getdbgregister DBGSTACK_USERCPSR_INDEX, r2 /* Retrieve User CPSR into R2 */
+ bl nx__abort_info /* void nx__abort_info(U32 data, U32 pc, U32 cpsr); */
+ pop {pc}
+
+#else
+/****************************************************************************
+ *
+ * NXT Firmware Abort Info LCD Display Routine
+ *
+ ****************************************************************************/
+dbg__display_abort_info:
+/* FIXME: Inteface with NXT Firmware LCD Display routines */
+ push {lr}
+ pop {pc}
+#endif
#ifdef __NXOS__
.extern debug_OutCommBuf
@@ -174,7 +211,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}
@@ -191,12 +229,15 @@ 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: 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