nurichard wrote on Thursday, July 03, 2014:
Hello,
In FreeRTOS v8.0.1 standard CM0 port, xTimerCreate(…) allows the software timer API calls to be made before the scheduler starts because xTimerCreate(…) calls prvCheckForValidListAndQueue() that actually creates the timer.c static xTimerQueue. Things like xTimerStart(…) can then be used as per the API documentation. Once the scheduler starts then the timer queue command is processed and the the commands are executed.
In comparison xTimerPendFunctionCall(…) can only be called once the xTimerQueue has been created. I can force xTimerQueue to have been created by creating and then deleting a timer before using xTimerPendFunctionCall(…) prior to starting the scheduler. As far as my limited abilities go this appears to be safe for v8.0.1 and would have worked for v7.5.2 that I was previously using (if it had such an API).
My workaround is a bit of a bodge; am I fundamentally misusing the xTimerPendFunctionCall(…) functionality by wanting to call it prior to starting the scheduler???
(Naturally I could create a task to call my function if this approach is fundamentally unsafe.)
Given the advertised ability to configure timers before the scheduler starts, it appears to me that xTimerPendFunctionCall(…) falls into a similar class of functionality. What was the original intention for the FreeRTOS API usage prior to the scheduler starting???
I found that many API calls could me made in v7.5.2 which worked as expected despite there not being an explicit comment in the documentation that it was safe to do this and I am concerned about using such API calls in a blase manner that could blow up in the future. Is there a list on the website API pages (that I have failed to find) which records which are expected to always be safe???
Thank you for your help,
Richard