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 <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-05-20 16:44:18 +08:00
parent 2c2b53303d
commit 4cca455c9b

View File

@ -161,6 +161,10 @@ void reset_port(void) {
pulsein_reset(); pulsein_reset();
#endif #endif
#if CIRCUITPY_RTC
rtc_reset();
#endif
timers_reset(); timers_reset();
#if CIRCUITPY_BLEIO #if CIRCUITPY_BLEIO