PIC32MZ Time delay interference using FreeRTOS

I’m not sure how calling vTaskStartScheduler() could effect it because if that function has not been called then there will be no multithreading and calling Delay_Us will result in the processor sitting in Delay_Us until the delay is complete. In other words if the scheduler has not been started then FreeRTOS cannot impact the function.

After the scheduler has been started is a different matter because any task calling Delay_Us can get preempted by any higher priority task, and therefore Delay_Us will not be accurate - the delay time achieved will be either the desired microsecond delay if no context switches occur, or an unknown time if context switches do occur.

1 Like