micropython/shared/runtime
robert-hh de1f1dd164 shared/runtime/softtimer: Use consistently the same clock source.
Before, both uwTick and mp_hal_ticks_ms() were used as clock source.  That
assumes, that these two are synchronous and start with the same value,
which may be not the case for all ports.  If the lag between uwTick and
mp_hal_ticks_ms() is larger than the timer interval, the timer would either
rush up until the times are synchronous, or not start until uwTick wraps
over.

As suggested by @dpgeorge, MICROPY_SOFT_TIMER_TICKS_MS is now used in
softtimer.c, which has to be defined in a port's mpconfigport.h with
the variable that holds the SysTick counter.

Note that it's not possible to switch everything in softtimer.c to use
mp_hal_ticks_ms() because the logic in SysTick_Handler that schedules
soft_timer_handler() uses (eg on mimxrt) the uwTick variable directly
(named systick_ms there), and mp_hal_ticks_ms() uses a different source
timer.  Thus it is made fully configurable.
2023-02-16 12:59:48 +11:00
..
gchelper.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
gchelper_generic.c shared/runtime/gchelper: Drop cpu directive from ARM asm helpers. 2023-01-28 15:51:38 +11:00
gchelper_native.c shared/runtime/gchelper_native: Fix pointer cast on x86_64. 2022-11-08 19:15:37 +11:00
gchelper_thumb1.s shared/runtime/gchelper: Drop cpu directive from ARM asm helpers. 2023-01-28 15:51:38 +11:00
gchelper_thumb2.s shared/runtime/gchelper: Drop cpu directive from ARM asm helpers. 2023-01-28 15:51:38 +11:00
interrupt_char.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
interrupt_char.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
mpirq.c shared/runtime: Use mp_printf consistently, instead of printf. 2023-01-24 16:57:26 +11:00
mpirq.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
pyexec.c shared/runtime: Use mp_printf consistently, instead of printf. 2023-01-24 16:57:26 +11:00
pyexec.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
semihosting.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
semihosting.h shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
softtimer.c shared/runtime/softtimer: Use consistently the same clock source. 2023-02-16 12:59:48 +11:00
softtimer.h shared/runtime/softtimer: Move softtimer.[ch] to shared/runtime. 2022-07-19 12:28:26 +10:00
stdout_helpers.c shared: Introduce new top-level dir and move 1st party lib code there. 2021-07-12 17:07:36 +10:00
sys_stdio_mphal.c py/obj: Convert make_new into a mp_obj_type_t slot. 2022-09-19 19:06:15 +10:00