-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix us_ticker for NRF52 series #6796
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
Changed comparison function when setting ticker timeout to fix tickers not set correctly.
@studavekar this might improve the lp_ticker_timeout problems we've been seeing. |
/morph build |
Build : SUCCESSBuild number : 1909 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 1556 |
Test : SUCCESSBuild number : 1727 |
/morph test |
I'll run today 2 more rounds (at least 3 test runs) |
Test : SUCCESSBuild number : 1737 |
/morph test |
Test : SUCCESSBuild number : 1741 |
/morph test |
Test : SUCCESSBuild number : 1744 |
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.
I looked at this PR in reference to #6732 and found one thing worth clarifying.
uint32_t closest_safe_compare = common_rtc_32bit_ticks_get() + 2; | ||
if ((int)(compare_value - closest_safe_compare) <= 0) { | ||
uint32_t closest_safe_compare = RTC_WRAP(common_rtc_32bit_ticks_get() + 2); | ||
if (closest_safe_compare - compare_value < 2) { |
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.
I might have missed something, but if compare_value
is equal to the current RTC ticks value, that is compare_value == common_rtc_32bit_ticks_get()
, this condition will be false and an invalid value will be written to CC register. Was that intentional? That new condition might well be replaced with: if (compare_value + 1 == closest_safe_compare)
.
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.
I think you are right. It should have been <= 2
in the comparison. However, the new 5.9 tickers are about to land so I don't think we should fix this.
Description
Changed comparison function when setting ticker timeout to fix
tickers not set correctly.
Pull request type