aboutsummaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-06-20 16:42:21 +0800
committerTat-Chee Wan (USM)2011-06-20 16:42:21 +0800
commit44dcbdc61981f8d2ebc24d125ce786b9595e7969 (patch)
treeea2f34edb8810f49eb3d72c739bb6a922b729b4d /AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
parentb7775a4899e29fe6f357a0d7e1160f4aac34c7e9 (diff)
parentfa5f16b48485cf0ddb3db3f2450e1ce99bb679ea (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebugGDB_BETA_2
Diffstat (limited to 'AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S')
-rw-r--r--AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S45
1 files changed, 44 insertions, 1 deletions
diff --git a/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S b/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
index 48b7e5a..f00e99d 100644
--- a/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
+++ b/AT91SAM7S256/armdebug/Debugger/debug_runlooptasks.S
@@ -115,13 +115,56 @@ dbg__runloopTasks:
b nx_core_reset /* Reboot Brick, won't return */
#else
+ .extern dIOCtrlSetPower
+ .extern dIOCtrlSetPwm
+ .extern dIOCtrlTransfer
+ .equ BOOT, 0xA55A
+ .equ POWERDOWN, 0x5A00
/****************************************************************************
*
* NXT Firmware Reboot Routine
*
****************************************************************************/
dbg__reboot:
- bx lr
+ /* Powerdown Sequence
+ dIOCtrlSetPower((POWERDOWN>>8));
+ dIOCtrlTransfer();
+
+ Reboot Sequence
+ dIOCtrlSetPower((UBYTE)(BOOT>>8));
+ dIOCtrlSetPwm((UBYTE)BOOT);
+ dIOCtrlTransfer();
+ */
+
+ /* We implement the powerdown sequence for now */
+
+#if 1
+ /* Powerdown sequence */
+ ldr r0, =((POWERDOWN >> 8) & 0xFF)
+ ldr r1, =dIOCtrlSetPower
+ mov lr,pc
+ bx r1
+#endif
+
+#if 0
+ /* Reboot sequence: this forces SAMBA mode??!! */
+ ldr r0, =((BOOT >> 8) & 0xFF)
+ ldr r1, =dIOCtrlSetPower
+ mov lr,pc
+ bx r1
+
+ ldr r0, =(BOOT & 0xFF)
+ ldr r1, =dIOCtrlSetPwm
+ mov lr,pc
+ bx r1
+#endif
+
+_dbg__reboot_wait:
+ ldr r1, =dIOCtrlTransfer
+ mov lr,pc
+ bx r1
+
+ b _dbg__reboot_wait /* Wait for AVR... */
#endif