Skip to content

switch to xtimer#3525

Merged
kaspar030 merged 128 commits intoRIOT-OS:masterfrom
kaspar030:switch_to_xtimer
Sep 16, 2015
Merged

switch to xtimer#3525
kaspar030 merged 128 commits intoRIOT-OS:masterfrom
kaspar030:switch_to_xtimer

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

This PR contains changes that drop hwtimer+vtimer and use periph/timer and xtimer instead.

Depends on #2926, those commits will go away as soon as xtimer itself is in. (merged)

I've included a small (and inefficient) vtimer wrapper which makes using xtimer a drop-in replacement. Even using that wrapper, the code and memory requirements are lower than using the original hwtimer+vtimer code in most cases, with a lot of room for improvements.

This is work in progress. A lot else will not work at the moment. I'm putting it out so people can comment and collaborate early. (no WIP anymore)

(Depends on #3837)

@kaspar030 kaspar030 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: needs squashing Commits in this PR need to be squashed; If set, CI systems will mark this PR as unmergable Type: new feature The issue requests / The PR implemements a new feature for RIOT Impact: major The PR changes a significant part of the code base. It should be reviewed carefully Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. State: waiting for other PR State: The PR requires another PR to be merged first TimerTaskForce Area: timers Area: timer subsystems labels Jul 30, 2015
@haukepetersen
Copy link
Copy Markdown
Contributor

Just successfully tested with the new Silicon Labs SLWSTK6220A board - which uses a 16-bit timer.

@OlegHahm
Copy link
Copy Markdown
Member

OlegHahm commented Aug 5, 2015

Just successfully tested with the new Silicon Labs SLWSTK6220A board - which uses a 16-bit timer.

Yay! 🍻

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about spending these some doxygen...

@haukepetersen
Copy link
Copy Markdown
Contributor

only some minor stuff (@kaspar: I know how you just love doxygen :-) ). Works with various boards with different sized timers.

Regarding the backoff times: Can't we just define them once for every CPU family, and compute it somehow from the selected core clock value? This could save some configuration for each board/cpu...

@kaspar030
Copy link
Copy Markdown
Contributor Author

@kaspar: I know how you just love doxygen

IMHO as a programmer you've made it if you can just pay someone to deal with doxygen. ;)

@kaspar030
Copy link
Copy Markdown
Contributor Author

Regarding the backoff times: Can't we just define them once for every CPU family, and compute it somehow from the selected core clock value? This could save some configuration for each board/cpu...

Probably. The values are dependent on clock-speed, periph/timer implementation and a CPU's interrupt handling speed. I thought about calibrating the values at boot time, if we could spare a tenth of a second there, or, as a first step, writing a test that determines the correct values.

@kaspar030
Copy link
Copy Markdown
Contributor Author

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • rebased

@haukepetersen
Copy link
Copy Markdown
Contributor

could you please rebase?

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • rebased

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • rebased

@kaspar030
Copy link
Copy Markdown
Contributor Author

  • fixed and directly amended squashed a license header mishap

@OlegHahm
Copy link
Copy Markdown
Member

I cannot test the l1 (USART is not running properly for weird reasons on my PC), so I cannot see the output of the test, but I'm all in favor or merging this since all other boards I tested passed the tests and gnrc_networking runs also fine on iotlab-m3 and samr21-xpro.

This feels like the most heavyweight ACK ever: ACK

@kaspar030, awesome work! (Particular considering you reluctance to work ever on timers again.) This PR IMO improves RIOT a lot! I leave the honor of pushing the button to you - if you like.

@haukepetersen
Copy link
Copy Markdown
Contributor

Nice! So go Travis, go!

@haukepetersen
Copy link
Copy Markdown
Contributor

Travis failed due to some Travis internal things - but I am unable to restart those two jobs. Does somebody else have better luck?

@kaspar030
Copy link
Copy Markdown
Contributor Author

No, can't restart either...

@cgundogan
Copy link
Copy Markdown
Member

me neither..

@haukepetersen
Copy link
Copy Markdown
Contributor

what do we do? I guess we do not expect build errors for those two builds, so merger anyway?

kaspar030 and others added 3 commits September 16, 2015 12:34
- more robust underflow protection in xtimer_usleep_until()
- use relative target in xtimer_spin()
- honour reference in isr when spinning until timer target
- add XTIMER_BACKOFF to xtimer_spin_until() target when backing off in
  _timer_set_absolute()
- doxygen updates
@kaspar030
Copy link
Copy Markdown
Contributor Author

  • null-rebased in order to get new commit so travis can do it's duty

@haukepetersen
Copy link
Copy Markdown
Contributor

ETA: 30min :-)

@kaspar030
Copy link
Copy Markdown
Contributor Author

dammit, I got a flight to catch :)

@haukepetersen
Copy link
Copy Markdown
Contributor

Come on, the flight can't be more important then merging this PR :-)

@kaspar030
Copy link
Copy Markdown
Contributor Author

Yeah, but it would be inconvenient to miss it. :)

@kaspar030
Copy link
Copy Markdown
Contributor Author

I see green!

Everybody, thanks a lot for the painful reviewing! Let's cross fingers that this probably most intrusive change since RIOT's existence will turn out to be good. ;)

GO.

kaspar030 added a commit that referenced this pull request Sep 16, 2015
@kaspar030 kaspar030 merged commit cca167e into RIOT-OS:master Sep 16, 2015
@kaspar030 kaspar030 deleted the switch_to_xtimer branch September 16, 2015 11:06
@cgundogan
Copy link
Copy Markdown
Member

Kudos!

@emmanuelsearch
Copy link
Copy Markdown
Member

awesome!!!

@jnohlgard
Copy link
Copy Markdown
Member

jnohlgard commented Sep 16, 2015 via email

@miri64
Copy link
Copy Markdown
Member

miri64 commented Sep 16, 2015

Yay. gz.

@thomaseichinger
Copy link
Copy Markdown
Member

Congratulations, to all of you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: timers Area: timer subsystems CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: major The PR changes a significant part of the code base. It should be reviewed carefully Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants