Description
Event queue porting layer is unnecessarily complicated for the RTOS environment - using Tickers and Timers to manage its time base. This in turn led to this patch to allow tuning of its timing: #5328 - original discussion of this issue occurred there.
In the RTOS, the event queue only actually needs to be able to check current tick count to determine elapsed time and decide what tick timeout to set on semaphore waits - it could just use osKernelGetTickCount
. This would reduce footprint and complexity, and avoid potential glitches from using two parallel time bases.
If the porting layer does still need to work in non-RTOS environments, the original code would still need to be maintained though, which means it's not a total win in terms of source complexity. But in effect it's just extending the #ifdef
that already exists around the semaphore wait.