Autosar WaitEvent equivalent API in FreeRTOS

To clarify … the operating system ALWAYS knows which task is running, so when you call xTaskDelay() it is from within the currently running task and therefore the operating system will put the currently running task into the blocked state.

You do not need to keep track yourself of which task is running.

Once the currnetly running task enters the blocked state, the task with highest priority which is in the ready state will transition to the running state.