Ticker, TimeOut, Timer Suggestion

03 Feb 2012

Ticker class improvement

I've been diggin' deeper and deeper with timers and I've seen a lot of begginers like myself having trouble with all these nicely done libraries for Timer interrupts.

This problems come from the "stacked" interrupts explained by Andy Kirkham http://mbed.org/users/AjK/notebook/regarding-interrupts-use-and-blocking/

So a nice improvement in the libraries would be to be able to specify wich timer you want your Ticker object, Timer obj... etc, to use.

Something like this:

Ticker   flipper( TMR0 );
TimeOut  onOff  ( TMR1 );

This will keep the functionality of the libraries while improving the flexibility of the program.

There are ways to do this using lower level programming, but it's messy, and for begginers very difficult to do