-
Notifications
You must be signed in to change notification settings - Fork 651
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
Incorrect implementation of is_oneshot() in trait Timer in kernel::hil::time #2018
Comments
You are right that the existing implementation is incorrect, and I think your correct implementation looks right as well. |
Ok! |
A PR would be welcome! There are ongoing efforts to revamp the alarm and timer traits, but they may not land in master for some time, so getting this fix in now would be great. |
I have opened an PR now, should I close this issue? |
I linked the PR, when it is merged this issue will be closed! |
As I was trying to implement the
Timer
trait fromkernel::hil::time
, I noticed that the functionis_oneshot()
is probably not correctly implemented.The current implementation is the following one:
However, the function
inverval()
says that it can returnNone
if the timer is configured as oneshot-timer OR if the timer is disabled:So I think a correct implementation would be something like this:
Am I right on this?
The text was updated successfully, but these errors were encountered: