I’m having an issue with timers and priorities.
I have a task that is responsible for flashing an LED according to a preset scheme: the task creates a one-shot timer, which in turn invokes a call-back function. This call-back function calls xTimerChangePeriod() on the timer with different timeouts, and so gets called back again at varying intervals. This part seems to work fine, and other tasks are running as intended, too. I’m using cooperative scheduling.
However, when I call xTimerChangePeriod() from the task the very first time, the function call never returns–that is, the task stays blocked regardless of the timeout I specify in xTimerChangePeriod(). (The timer nonetheless gets started, and the call-back does exactly what it’s supposed to do.)
It turned out that I had set the configTIMER_TASK_PRIORITY above that of the task that calls xTimerChangePeriod(). Lowering the timer priority allows the task to become unblocked after the function call, and so the system works as intended.
But … I wouldn’t expect the task to become permanently blocked by calling xTimerChangePeriod() simply because the task has a lower priority. What am I missing?