Skip to content

Commit 4cca455

Browse files
committed
nrf: reset rtc as part of port_reset()
On NRF, the `rtc_reset()` function is never called. As a result, calls to `time.time()` return a cryptic error> ``` >>> import time >>> time.time() '' object has no attribute 'datetime' >>> ``` This is because `MP_STATE_VM(rtc_time_source)` is not initialized due to `rtc_reset()` never being called. If `CIRCUITPY_RTC` is enabled, call `rtc_reset()` as part of the `reset_port()` call. This ensures that `time.time()` works as expected. Signed-off-by: Sean Cross <[email protected]>
1 parent 2c2b533 commit 4cca455

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ports/nrf/supervisor/port.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ void reset_port(void) {
161161
pulsein_reset();
162162
#endif
163163

164+
#if CIRCUITPY_RTC
165+
rtc_reset();
166+
#endif
167+
164168
timers_reset();
165169

166170
#if CIRCUITPY_BLEIO

0 commit comments

Comments
 (0)