-
Notifications
You must be signed in to change notification settings - Fork 3k
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 problem with low level lp_ticker STM wrapper #11385
Conversation
4551399
to
5cb7297
Compare
@Tharazi97, thank you for your changes. |
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 this change makes sense and is properly described ... thank you
2 minor remarks / questions
targets/TARGET_STM/lp_ticker.c
Outdated
/* If this target timestamp is close to the roll over of the ticker counter | ||
* and current tick is also close to the roll over, then we are in danger zone.*/ | ||
if(((0xFFFF - LP_TIMER_SAFE_GUARD < timestamp) || (timestamp < LP_TIMER_SAFE_GUARD)) | ||
&& ((0xFFFA < last_read_counter) || (last_read_counter < LP_TIMER_SAFE_GUARD))) |
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.
Why is the condition (last_read_counter < LP_TIMER_SAFE_GUARD)
also needed ?
If this is the case, then the rollover already happened, right ?
I don't think it would cause an issue though ...
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.
You are right. It could do some mess if you want to set timestamp to 0xFFFF, or something close to, and current tick is at the beginning of the counter.
targets/TARGET_STM/lp_ticker.c
Outdated
&& ((0xFFFA < last_read_counter) || (last_read_counter < LP_TIMER_SAFE_GUARD))) | ||
{ | ||
roll_over_flag = true; | ||
/* Change the lp_delayed_counter buffor in that way so the value of (0xFFFF - LP_TIMER_SAFE_GUARD) is equal to 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.
type buffor / buffer
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.
Done
5cb7297
to
36dfbca
Compare
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
targets/TARGET_STM/lp_ticker.c
Outdated
/* If this target timestamp is close to the roll over of the ticker counter | ||
* and current tick is also close to the roll over, then we are in danger zone.*/ | ||
if(((0xFFFF - LP_TIMER_SAFE_GUARD < timestamp) || (timestamp < LP_TIMER_SAFE_GUARD)) && (0xFFFA < last_read_counter)) | ||
{ |
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.
please fix the style in the file (=consistency)
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.
Done
36dfbca
to
3e1aa43
Compare
3e1aa43
to
a95450b
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.
look good
Started CI |
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 a lot !
Test run: FAILEDSummary: 1 of 11 test jobs failed Failed test jobs:
|
CI fail seems not related. |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Fixes #11373
I have changed the STM implementation of low level lp ticker wrapper in way that it checks if event gets outdated while waiting for CMPOK flag. I have also added a solution of handling events that are close to ticker counter roll over. It changes the base of the timestamp so it can be easily compared with other values around max counter value.
Pull request type
Reviewers
@maciejbocianski @mprse @jamesbeyond @LMESTM @0xc0170
Release Notes