Skip to content

Commit d8ede1c

Browse files
committed
run time modified can't be const
1 parent 592fd32 commit d8ede1c

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

cc/cc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4457,8 +4457,9 @@ int cc(int mode, int argc, char** argv) {
44574457
fd = NULL;
44584458
if (fs_setattr(full_path(ofn), 1, "exe", 4) < LFS_ERR_OK)
44594459
fatal("unable to set executable attribute");
4460-
printf("\ntext size %06x\ndata size %06x\nentry point %06x\nreloc count %06x\n",
4461-
exe.tsize, ds, exe.entry - (int)text_base, exe.nreloc);
4460+
printf(
4461+
"\ntext size 0x%04x\ndata size 0x%04x\nentry point 0x%04x\nreloc count %6d\n",
4462+
exe.tsize, ds, exe.entry - (int)text_base, exe.nreloc);
44624463
goto done;
44634464
}
44644465
if (src_opt)

main.c

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

14-
#include "hardware/structs/scb.h"
15-
#include "hardware/watchdog.h"
16-
1714
#include "pico/bootrom.h"
1815
#include "pico/stdio.h"
1916
#include "pico/stdlib.h"
@@ -762,13 +759,16 @@ static void vi_cmd(void) {
762759
vi(argc - 1, argv + 1);
763760
}
764761

762+
#define AIRCR (*((volatile uint32_t*)(PPB_BASE + 0x0ED0C)))
763+
765764
static void reboot_cmd(void) {
766765
// release any resources we were using
767766
if (mounted) {
768767
savehist();
769768
fs_unmount();
770769
}
771-
watchdog_reboot(0, 0, 1);
770+
sleep_ms(500);
771+
AIRCR = 0x5FA0004;
772772
for (;;)
773773
;
774774
}
@@ -950,9 +950,10 @@ static void Fault_Handler(void) {
950950
for (;;)
951951
;
952952
#endif
953-
watchdog_reboot(0, 0, 3000);
953+
sleep_ms(3000);
954+
AIRCR = 0x5FA0004;
954955
for (;;)
955-
__wfi();
956+
;
956957
}
957958

958959
static bool run_as_cmd(const char* dir) {

0 commit comments

Comments
 (0)