-
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
native: add native periph timer #2870
Conversation
PR needs rebase for Travis mirror setup |
699886e
to
83df6d3
Compare
rebased. |
I'm aware that this will collide with the native hwtimer implementation. But the (soon to come) new timer subsystem will drop hwtimer, and I'd like native users to be able to test... edit "collide" meaning, if anyone uses hwtimer and this PR's driver to actually set a timer, one will overwrite the other. |
Maybe catch this case in make? |
Not so easy as hwtimer is still a core dependency with lots of uses. |
Print out a big red blinking warning instead of failing then.. |
Could we also use the hwtimer wrapper used by some platforms to keep compatibility? |
I don't know about the details, but I'd actually prefer that if it is what I think it is. |
Some platforms wrap the hwtimer interface around one periph timer so as to fulfill the core hwtimer dependancies. We could do the same here. Will do shortly. |
28a12d2
to
f6574d6
Compare
|
This PR includes parts of #2913 now? |
uff, yes. I didn't want to just copy the hwtimer->periph wrapper. So I made it a module and PR'ed it. It's very simple, and Hauke already ACKed it, but yes, I cherry-picked it in here. |
I just wondered if this PR needs a label indicating its dependency on another PR. |
4dcd52c
to
76cc50e
Compare
|
PS: |
#else | ||
|
||
if (real_clock_gettime(CLOCK_MONOTONIC, &t) == -1) { | ||
err(EXIT_FAILURE, "hwtimer_arch_now: clock_gettime"); |
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.
s/hwtimer_arch_now/timer_read/
I could also try to test this on OS X if someone explains how I should test ;) |
@emmanuelsearch If the vtimer_msg test works, everything should be fine! |
mmmh define working. It seems to hang after some time (no consistent duration after which it hangs though). Below an example of what I get (but it can also happen that it hangs sooner, e.g. right after the first message is received in the second thread):
(and then it hangs) |
You might be hitting the vtimer bugs. Can you check the master branch? |
Master branch does not compile right now on OS X for the vtimer_msg test. Below the error I get:
|
@emmanuelsearch Please open an issue for this problem including your system and toolchain version. |
done #3175 |
d3dadd2
to
4996944
Compare
|
@emmanuelsearch please retest! |
4996944
to
6456817
Compare
Does not compile on OS X as is. Will PR a small change that makes it compile later today. Still hangs after random amount of time (sometimes seems to run normally).
should I try merging/testing something else? |
native: fixed OS X includes in periph/timer.c
@emmanuelsearch Does master behave differently for that test? |
I meant this one: master is not even building on OS X,b ut with #3288 and #3290, the tests behaved more or less the same IIRC. @emmanuelsearch, might correct me. |
IMHO, if this is as good or better as master, we should merge and wait for improvements by #3282. |
👍 Let's wait what @emmanuelsearch says. |
Still does not work as well as on master... |
Actually this is obsoleted by #3282, master contains this. |
great ;) |
This PR adds a simple wrapper from periph/timer.h to host itimers.
It is based un @LudwigOrtmann hwtimer implementation. I've dropped the multiplexing, though.
One of the commits marks some functions in
hwtimer.c
static
, as one of them was colliding withtimer.c
.