Wykres commitów

3 Commity (de1f1dd164958273c4ab62a46fdfe8a2f40ab1cf)

Autor SHA1 Wiadomość Data
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
robert-hh 93a17b9581 shared/runtime/softtimer: Remove obsolete #include statement. 2022-07-19 13:46:28 +10:00
robert-hh 2e2202993c shared/runtime/softtimer: Move softtimer.[ch] to shared/runtime.
And change the include lock to the naming scheme of that place.

This comes from ports/stm32/softtimer.[ch].
2022-07-19 12:28:26 +10:00