Today I again had an application were the only interesting information about a specific FreeRTOS software time is whether it is running or not (blocking a specific path as long as a timeout has not expired). So I don’t need a callback.
But currently the code on expiration in timers.c is
/* Call the timer callback. */
traceTIMER_EXPIRED( pxTimer );
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
Instead of
/* Call the timer callback. */
traceTIMER_EXPIRED( pxTimer );
if(pxTimer->pxCallbackFunction != NULL)
{
pxTimer->pxCallbackFunction( ( TimerHandle_t ) pxTimer );
}
Which means I need to create an empty function to prevent a crash at that point.
Wouldn’t it be more stable and comfortable, with a very negligible performance impact, to use the later? As soon as there is one timer which doesn’t nee a callback it also saves code space.