Either I am misunderstanding the API, xTaskNotifyStateClear or there must be a bug.
ulTaskNotifyTake(TRUE, 30000) returns immediately after even I clear any pending notifications by calling xTaskNotifyStateClear(NULL) right before I call ulTaskNotifyTake().
Both functions are called by same task.
And I triple-checked to make sure that there is absolutely no vTaskNotifyGive() called while those two functions are called.
Obviously vTaskNotifyGive() is called several times before I call xTaskNotifyStateClear().
This is all for testing to make sure xTaskNotifyStateClear() is working the way it’s described.
So below is a sequence of calls:
Task A calls vTaskNotifyGive(TaskB_Handle)
Task A calls vTaskNotifyGive(TaskB_Handle)
Task A calls vTaskNotifyGive(TaskB_Handle)
Task B calls vTaskNotifyStateClear(NULL)
Task B call vTaskNotifyTake(TRUE, 30000)
Amazingly vTaskNotifyTake() returns immediately.
Does anyone know if I am misunderstanding something here?
Appreciate help.
Regards,
James