-
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
Initial import of low-level timer driver interface #614
Initial import of low-level timer driver interface #614
Conversation
* | ||
* This file is subject to the terms and conditions of the LGPLv2 License. | ||
* See the file LICENSE in the top level directory for more details. | ||
*/ |
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.
We don't need Copyright headers in h files.
Apart from the comments: ack. |
I intentionally didn't name it timer_now(), as I wanted to keep a clear separation between the (hardware) base driver and the v- and hwtimers. But I guess its just my personal opinion... |
I'm also fine with that. Just a thought. |
ACK from my side. Deployed on the iot-lab_M3 for openwsn integration and it works 😉 👍 |
* @param timeout timeout in ticks after that the registered callback is executed | ||
* @return 1 on success, -1 on error | ||
*/ | ||
int timer_set(tim_t dev, int channel, int timeout); |
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.
int might not be a good choice for timeout as it can not take negative values and the maximum value is not so large, especially on 16bit platforms.
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.
remember, we are talking about a low-level interface, the given timeout will be written into a capture/compare register -> and these are normally not larger then 32 or 16 bit, so int should be sufficient for 99% of the platforms.
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.
What about the un/signed though?
small adjustments:
@thomaseichinger could you maybe test this also with your implementation? |
works for me, ACK holds |
For clarification: This should be the interface for the arch dependent hwtimer implementation? |
Think about direction tags in |
done |
*/ | ||
typedef enum { | ||
#if TIMER_0_EN | ||
TIMER_0 = 0, /*< 1st timer */ |
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 doxygen needs /**< 1st timer */
here.
@thomaseichinger fixed. |
Could need some squashing, otherwise ready to be merged, I guess? |
almost ready, one final ACK missing |
ACK when squashed. |
rebased, squashed and go |
Initial import of low-level timer driver interface
Fixed spelling drivers: adjustments to low-level timer driver IF drivers: added [in|out] to @param documentation drivers: fixed doxygen for tim_t typedef
Proposal for a low-level timer driver.
This driver gives a hardware independent access to hardware timers. This driver is mainly intended to be used by the hwtimer, as the hwtimer implementation is quite trivial using this driver.