Description
When I was working on nrf24 code, I tried moving the rf logic to Core1, and got lots timeouts and delays. This initially got me thinking about some hw slowness due to locks etc, but luckily it narrowed down to micro_clock
being very imprecise when called from Core1. While running on Core0, the delays between nrf24 write and interrupt ack would be ~350us, and on Core1 I was getting 0 and ~1ms.
RP2040 provides microsecond time via 64 bit counter.
And if I replace the code of modm::chrono::micro_clock::now()
in platform/clock/systick_timer.cpp
with reading the timer_hw->timel*
registers, I get reliable time with a microsend resolution on both cores.
I can make a PR with the changes. Q: Should I %if
the implementation based on the target and keep it in the same systick_timer.cpp
or should modm::chrono::micro_clock::now()
be moved to some rp2040 related file for this case?