Preempting a idle task Figure 27 Hands-on_Tutorial_Guide

Hello all,
Have a ? about what happens between t5 and t8 in fig. 27 Task1 is run since it becomes ready and preempts Idle task. Task 1 finishes, enters blocked state. Why does the scheduler choose Task2 instead of Task1 since it looks like we are still inside the time slice of the idle task. Or is that not how it works and the scheduler chooses task2 because it always alternates between tasks of equal priority when no other higher priority task is ready.
TIA
Joe

I assume you are talking about the image in this PDF: https://www.freertos.org/Documentation/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf

Task1 is not ready (as it entered the block state) and therefore, cannot run. If you are asking why IDLE task was not picked - that is because scheduler does round robin among same priority tasks.

Additionally, you can set configIDLE_SHOULD_YIELD to 1 so that the Idle task will voluntarily give up whatever remains of its allocated time slice.

Thanks.

Yes, I am asking why the idle task was not ran after task1. Because scheduler does round robin. Ok, thanks and sorry for typing task1 when I meant idle task.