circuitpython/ports
Martin Fischer 15574cd665 nrf: Add support for time.ticks_xxx functions using RTC1.
This commit adds time.ticks_ms/us support using RTC1 as the timebase.  It
also adds the time.ticks_add/diff helper functions.  This feature can be
enabled using MICROPY_PY_TIME_TICKS.  If disabled the system uses the
legacy sleep methods and does not have any ticks functions.

In addition support for MICROPY_EVENT_POLL_HOOK was added to the
time.sleep_ms(x) function, making this function more power efficient and
allows support for select.poll/asyncio.  To support this, the RTC's CCR0
was used to schedule a ~1msec event to wakeup the CPU.

Some important notes about the RTC timebase:

- Since the granularity of RTC1's ticks are approx 30usec, time.ticks_us is
not perfect, does not have 1us resolution, but is otherwise quite usable.
For tighter measurments the ticker's 1MHz counter should be used.

- time.ticks_ms(x) should *not* be called in an IRQ with higher prio than
the RTC overflow irq (3).  If so it introduces a race condition and
possibly leads to wrong tick calculations.

See #6171 and #6202.
2020-07-08 23:47:02 +10:00
..
bare-arm ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports. 2020-06-16 22:06:21 +10:00
cc3200 stm32/irq: Clean up irq.h so it does not depend on core uPy defines. 2020-06-22 13:47:15 +10:00
esp32 esp32/esp32_rmt: Call rmt_driver_install before rmt_config. 2020-06-19 22:11:14 +10:00
esp8266 esp8266/esppwm: Fix PWM glitch when setting duty on different channel. 2020-05-27 16:15:28 +10:00
javascript all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
mimxrt mimxrt/boards: Set __heap_size__ to 0 in MIMXRT1011.ld. 2020-06-10 22:49:26 +10:00
minimal ports: Disable MICROPY_PY_ASSIGN_EXPR in bare-arm and minimal ports. 2020-06-16 22:06:21 +10:00
nrf nrf: Add support for time.ticks_xxx functions using RTC1. 2020-07-08 23:47:02 +10:00
pic16bit all: Format code to add space after C++-style comment start. 2020-04-23 11:24:25 +10:00
powerpc powerpc/uart: Choose which UART to use at build time, not runtime. 2020-05-29 22:54:55 +10:00
qemu-arm qemu-arm/Makefile: Add CFLAGS_EXTRA to CFLAGS. 2020-06-22 13:42:24 +10:00
samd all: Factor gchelper code to one place and use it for unix & ARM ports. 2020-04-29 23:45:19 +10:00
stm32 stm32/mboot: Disable polling mode by default and use IRQ mode instead. 2020-07-01 16:54:03 +10:00
teensy stm32/irq: Clean up irq.h so it does not depend on core uPy defines. 2020-06-22 13:47:15 +10:00
unix unix: Enable uasyncio on dev variant. 2020-07-01 22:44:41 +10:00
windows windows: Make appveyor.yml self-contained. 2020-05-28 09:56:35 +10:00
zephyr zephyr/make-minimal: Disable FAT and LFS2 options to make it build. 2020-06-30 22:33:41 +10:00