-
Notifications
You must be signed in to change notification settings - Fork 3k
Provide fix for issue #5835 - Tickers update should be atomic #5889
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
Provide fix for issue #5835 - Tickers update should be atomic #5889
Conversation
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.
Thanks for the testing before/after 👍
/morph build |
Build : SUCCESSBuild number : 898 Triggering tests/morph test |
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.
If ever the time spent in critical section is too long, I suppose this can be rewritten in way where all the computation happen outside of the critical section.
The only parts that needs protection are data reads and data writes.
Exporter Build : SUCCESSBuild number : 573 |
/morph test |
Test : FAILUREBuild number : 742 |
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.
One alternative you may want to consider is synchronizing only (and all) the public functions. Remaining function which could benefit from synchronization:
- ticker_set_handler
- ticker_irq_handler
- ticker_read_us
- ticker_read (implicitly synchronized if ticker_read_us is)
Provided fix has influence on |
Synchronise only (and all) the public functions.
c5bb736
to
6d3ba94
Compare
As suggested by @c1728p9 synchronized only (and all) the public functions. Tested ( Please review. |
/morph build |
1 similar comment
/morph build |
Build : SUCCESSBuild number : 907 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 582 |
Test : SUCCESSBuild number : 749 |
Description
Perform update of the present time in critical section.
Status
READY
Migrations
NO
Steps to test or reproduce
While working on new lp ticker driver for NRF51_DK board (#5629), some problems with lp ticker has been detected.
Performed test:
We expect that isr() function will be executed about 1000 times and exit from while loop is after one second:
Test results without this fix NRF51_DK/GCC_ARM:
Test results with this fix NRF51_DK/GCC_ARM: