nrf: add support for threading
hi Micropython,
could you please add thread to nrf as some cusotmer in china need micropython support multi-thread function. currently, it is not supported on nrf51&52 platform.
my email is george.xiong@nordicsemi.no
thanks.
Best regards
george
Feat nrf time rtc support
This is a cleanup version of the inputs collected in https://github.com/micropython/micropython/pull/6171
(I didn't want to force push the update to that PR because it contains implementation details
via ticker module that might be useful for others)
Basically it adds support for time.ticks_ms / time.ticks_us via RTC1, configured in 30usec tick mode. It also
adds the time.ticks_add and time.ticks_diff helper functions.
For this to work properly the RTC1's overflow irq is handled and a msec / usec ticks counter appropiately
generated (see also commit comment for this relatively complex matter). Thanks for @dpgeorge for
basically providing the solution there!
The PR also contains support for MICROPY_EVENT_POLL_HOOK. The wakeup from WFI is done via RTC1's
CCR0, configured in app. 1msec intervals. Basically that makes the nrf port ready for asyncio.
This feature can be enabled using MICROPY_PY_TIME_TICKS. If disabled, the system uses the legacy
ticks and sleep methods.