-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix inaccurate ticks in windows port #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Root cause: Sleep() in Windows is not guaranteed to be realtime. Usage of Sleep() was causing ticks in Windows port to be incorrect. Solution: Use Waitable Timer in Windows for more accuracy.
|
This is a great change - although currently the change in timing makes some of our self monitoring tests fail as they were tuned to using the current method. We will need to fix up the test timing at the same time as accepting this PR. |
|
|
||
| /* Set the Waitable Timer. The timer is set to run periodically at every | ||
| xWaitTimeBetweenTicks milliseconds. */ | ||
| configASSERT( SetWaitableTimer( hTimer, &liDueTime, xWaitTimeBetweenTicks, NULL, NULL, 0 ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: better to separate to two lines for debugging purpose.
qiutongs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me.
|
This one has become stale since the Kernel is now a submodule. I recreated it as FreeRTOS/FreeRTOS-Kernel#142 |
* Remove multiple_priorities_no_timeslice_covg, single_priority_no_timeslice_covg and single_priority_timeslice_thread test folders and move the covg utest.c to the folder with same FreeRTOSConfig.h * Add configUSE_TICKLESS_IDLE config in single_priority_no_timeslice test group * Add configUSE_MINIMAL_IDLE_HOOK config in single_priority_timeslice test group
* Remove multiple_priorities_no_timeslice_covg, single_priority_no_timeslice_covg and single_priority_timeslice_thread test folders and move the covg utest.c to the folder with same FreeRTOSConfig.h * Add configUSE_TICKLESS_IDLE config in single_priority_no_timeslice test group * Add configUSE_MINIMAL_IDLE_HOOK config in single_priority_timeslice test group
* Fix Pico compile warning -- port layer * Warning resolved for volatile discard task.c (FreeRTOS#5) --------- Co-authored-by: Pranjal Chanda <[email protected]> Co-authored-by: Gaurav-Aggarwal-AWS <[email protected]>
Root cause: Sleep() in Windows is not guaranteed to be realtime. Usage of Sleep()
was causing ticks in Windows port to be incorrect.
Solution: Use Waitable Timer in Windows for more accuracy.