I understand that xTaskNotifyGive() can be used to unblock a task blocked by xTaskNotifyTake().
But should xTaskNotifyGive() also unblock a task if blocked by vTaskDelayUntil() ?
It seems to during testing, I assumed the xTaskNotifyGive() would only unblock the corresponding xTaskNotifyTake().
But should xTaskNotifyGive() also unblock a task if blocked by vTaskDelayUntil() ?
No - xTaskNotifyGive() will only unblock a task that is specifically waiting for a notification. xTaskAbortDelay() is the only API function that will unblock a task that called vTaskDelayUntil().
I’ve attached the source file, there isn’t much of it - maybe you can take a look.
If I comment out xTaskNotifyGive() and xTaskNotifyTake() calls within the functions prvTask1() and prvTask2() my test LED ( CMP_ON ) flashes at 200ms rate as expected.
If the xTaskNotifyGive() and xTaskNotifyTake() calls are put in place ( as per the attached file ) the LED flashes at a very high rate as if the vTaskDelayUntil() function is falling through. I wouldn’t expect these function to have any significant effect on the 200ms flash rate.
Where is my misunderstanding ?
I know there are much easiers ways to flash a LED !
Thanks for the log, I think I understand my oversight now.
The effect of the TaskNotify calls is to ‘synchronize’ the two functions. This meant that the tasks were still executing every 200ms but my LED appeared to stop flashing because the two tasks calls were now in immediate succession due o the ‘synchronization’. Whilst the tasks become synchromized one of the tasks must have been blocked for >200ms whilst waiting on the Notify.
Do you have a second LED for testing?
If so, you might assign a LED to each of the tasks and toggle it after every delay.
Andif not: assign the LED to task-1 only and have it toggle the LED after every delay.