Skip to content

Commit 1200886

Browse files
committed
links
1 parent 5599ec8 commit 1200886

File tree

3 files changed

+38
-25
lines changed

3 files changed

+38
-25
lines changed

ports/nordic/common-hal/microcontroller/Processor.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ void common_hal_mcu_processor_get_uid(uint8_t raw_id[]) {
3333
}
3434

3535
mcu_reset_reason_t common_hal_mcu_processor_get_reset_reason(void) {
36-
mcu_reset_reason_t r = RESET_REASON_UNKNOWN;
37-
if (reset_reason_saved == 0) {
38-
r = RESET_REASON_POWER_ON;
39-
} else if (reset_reason_saved & POWER_RESETREAS_RESETPIN_Msk) {
40-
r = RESET_REASON_RESET_PIN;
41-
} else if (reset_reason_saved & POWER_RESETREAS_DOG_Msk) {
42-
r = RESET_REASON_WATCHDOG;
43-
} else if (reset_reason_saved & POWER_RESETREAS_SREQ_Msk) {
44-
r = RESET_REASON_SOFTWARE;
45-
#if CIRCUITPY_ALARM
46-
// Our "deep sleep" is still actually light sleep followed by a software
47-
// reset. Adding this check here ensures we treat it as-if we're waking
48-
// from deep sleep.
49-
if (sleepmem_wakeup_event != SLEEPMEM_WAKEUP_BY_NONE) {
50-
r = RESET_REASON_DEEP_SLEEP_ALARM;
51-
}
52-
#endif
53-
} else if ((reset_reason_saved & POWER_RESETREAS_OFF_Msk) ||
54-
(reset_reason_saved & POWER_RESETREAS_LPCOMP_Msk) ||
55-
(reset_reason_saved & POWER_RESETREAS_NFC_Msk) ||
56-
(reset_reason_saved & POWER_RESETREAS_VBUS_Msk)) {
57-
r = RESET_REASON_DEEP_SLEEP_ALARM;
58-
}
59-
return r;
36+
// mcu_reset_reason_t r = RESET_REASON_UNKNOWN;
37+
// if (reset_reason_saved == 0) {
38+
// r = RESET_REASON_POWER_ON;
39+
// } else if (reset_reason_saved & POWER_RESETREAS_RESETPIN_Msk) {
40+
// r = RESET_REASON_RESET_PIN;
41+
// } else if (reset_reason_saved & POWER_RESETREAS_DOG_Msk) {
42+
// r = RESET_REASON_WATCHDOG;
43+
// } else if (reset_reason_saved & POWER_RESETREAS_SREQ_Msk) {
44+
// r = RESET_REASON_SOFTWARE;
45+
// #if CIRCUITPY_ALARM
46+
// // Our "deep sleep" is still actually light sleep followed by a software
47+
// // reset. Adding this check here ensures we treat it as-if we're waking
48+
// // from deep sleep.
49+
// if (sleepmem_wakeup_event != SLEEPMEM_WAKEUP_BY_NONE) {
50+
// r = RESET_REASON_DEEP_SLEEP_ALARM;
51+
// }
52+
// #endif
53+
// } else if ((reset_reason_saved & POWER_RESETREAS_OFF_Msk) ||
54+
// (reset_reason_saved & POWER_RESETREAS_LPCOMP_Msk) ||
55+
// (reset_reason_saved & POWER_RESETREAS_NFC_Msk) ||
56+
// (reset_reason_saved & POWER_RESETREAS_VBUS_Msk)) {
57+
// r = RESET_REASON_DEEP_SLEEP_ALARM;
58+
// }
59+
// return r;
6060
}

supervisor/zephyr/port.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ void reset_cpu(void) {
1818
}
1919
}
2020

21-
void reset_port(void);
21+
void reset_port(void) {
22+
23+
}
2224

2325
void port_wake_main_task(void) {
2426
}
@@ -63,6 +65,9 @@ uint32_t port_get_saved_word(void) {
6365
return 0;
6466
}
6567

68+
uint64_t port_get_raw_ticks(uint8_t *subticks) {
69+
return 0;
70+
}
6671

6772
// Enable 1/1024 second tick.
6873
void port_enable_tick(void) {
@@ -74,6 +79,12 @@ void port_disable_tick(void) {
7479

7580
}
7681

82+
void port_interrupt_after_ticks(uint32_t ticks) {
83+
}
84+
85+
void port_idle_until_interrupt(void) {
86+
}
87+
7788
void *port_malloc(size_t size, bool dma_capable) {
7889
void *block = k_malloc(size);
7990
return block;

tools/cpbuild/build_circuitpython.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ async def build_circuitpython():
166166
circuitpython_flags.append(f"-DCIRCUITPY_USB_HOST={1 if usb_host else 0}")
167167
circuitpython_flags.append(f'-DCIRCUITPY_BOARD_ID=\\"{board}\\"')
168168
circuitpython_flags.append(f"-DCIRCUITPY_TUSB_MEM_ALIGN={tusb_mem_align}")
169+
circuitpython_flags.append("-DINTERNAL_FLASH_FILESYSTEM")
169170
circuitpython_flags.append('-DFFCONF_H=\\"lib/oofatfs/ffconf.h\\"')
170171
circuitpython_flags.extend(("-I", srcdir))
171172
circuitpython_flags.extend(("-I", srcdir / "lib/tinyusb/src"))
@@ -301,6 +302,7 @@ async def build_circuitpython():
301302
source_files.append(srcdir / "shared/timeutils/timeutils.c")
302303
source_files.append(srcdir / "shared-module/time/__init__.c")
303304
source_files.append(srcdir / "shared-module/os/__init__.c")
305+
source_files.append(srcdir / "shared-module/supervisor/__init__.c")
304306

305307
assembly_files = []
306308
assembly_files.append(srcdir / "ports/nordic/supervisor/cpu.s")

0 commit comments

Comments
 (0)