Skip to content

Commit 1513314

Browse files
committed
use direct software reset
1 parent d8ede1c commit 1513314

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <stdarg.h>
1212
#include <stdio.h>
1313

14+
#include "hardware/structs/scb.h"
15+
1416
#include "pico/bootrom.h"
1517
#include "pico/stdio.h"
1618
#include "pico/stdlib.h"
@@ -759,16 +761,14 @@ static void vi_cmd(void) {
759761
vi(argc - 1, argv + 1);
760762
}
761763

762-
#define AIRCR (*((volatile uint32_t*)(PPB_BASE + 0x0ED0C)))
763-
764764
static void reboot_cmd(void) {
765765
// release any resources we were using
766766
if (mounted) {
767767
savehist();
768768
fs_unmount();
769769
}
770770
sleep_ms(500);
771-
AIRCR = 0x5FA0004;
771+
scb_hw->aircr = 0x5FA0004;
772772
for (;;)
773773
;
774774
}
@@ -951,7 +951,7 @@ static void Fault_Handler(void) {
951951
;
952952
#endif
953953
sleep_ms(3000);
954-
AIRCR = 0x5FA0004;
954+
scb_hw->aircr = 0x5FA0004;
955955
for (;;)
956956
;
957957
}

0 commit comments

Comments
 (0)