-
Notifications
You must be signed in to change notification settings - Fork 2k
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
drivers/kw2xrf: Use TMR3 instead TMR4 to detect ACK timeout #12287
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.
@benpicco proposed some deduplication which I would like to see too. There is more room for improvement in this driver, but for the first step this change should be good. @Ilmu please address @benpicco's comments and answer open questions. Furthermore, could leave some short comments next to your code (stuff like enable/disable timer X, ...) because the existing functions that you re-use are not very intuitive and also not well documented.
I'll run some tests very soon.
@benpicco It looks like the difference between @PeterKietzmann I also removed the duplicate code and added some comments. |
Looks much better & easier to understand now with the smaller if blocks! |
Feel free to squash. |
Squashed it :) |
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.
@Ilmu011 thanks for addressing all comments. The code looks good now! I've tested it by placing LED0_ON
and LED0_OFF
here and here and measuring the timeout value with a logic analyzer (to do so I flashed gnrc_networking and did a ping6
to a non existing address). Both master and this PR behave similar and take a bit more than 900us on a phytec board.
@Ilmu011 I think one commit should be enough here. Please squash all together and name it something alike the first commit. |
@PeterKietzmann Done. |
Congrats to your first RIOT contribution! |
Originally posted by @PeterKietzmann in #12083
This driver currently uses TMR4 to detect ACK timeouts in TR operations. There is a dedicated timer for detecting timeouts in RX-operations and that is TMR3. I am working on #10364 right now and the kw41z driver uses TMR3 for this purpose, which seems to make more sense.
See section 7.6.2 of the Reference Manual "Using T3CMP to Abort an RX operation"