-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Fix time conversion issues in PAL events #1566
Fix time conversion issues in PAL events #1566
Conversation
Hi @martin-kuhn, I'm nanoFramework bot. A human will be reviewing it shortly. 😉 |
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.
Looks good. I'm yet to test this further to make sure the timings are correct.
Running the timer sample shows some curious results:
🤔 this smells like a watchdog issue.... |
Care to merge the latest changes from develop branch please so this can be merged? |
Yes, it's done. |
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.
LGTM!
- Port changes from nanoframework#1566 to ESP32, NXP and TI platforms. - Improve check of "no delay" condition and dequeue and execute immediately instead of calling the timer API just because. Signed-off-by: josesimoes <jose.simoes@eclo.solutions>
- After the fix with nanoframework#1566 STM32 targets where rebooting on idle. The reason was the watchdog kicking in as the wait now happens inside the Events_WaitForEvents loop. Signed-off-by: josesimoes <jose.simoes@eclo.solutions>
Description
Debug checks showed, that the chVTSet method is always called with a delay of zero, which should not be done.
The delay of zero was caused by dividing the ticks value by TIME_CONVERSION__TO_MILLISECONDS (=10000) which is not necessary. The compareValueTicks is already in CMSIS Ticks there, which is equal to milliseconds.
We also have to use the HAL_Time_CurrentSysTicks() method wherever the value is in CMSIS ticks instead of the HAL_Time_CurrentTime() method which returns a value in .NET ticks.
How Has This Been Tested?
This has been tested on a custom STM32F427 based MCU board.
Types of changes
Checklist:
Signed-off-by: Martin Kuhn martin.kuhn@csa.ch