ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.17k stars 386 forks source link

Add templated ticker type for callback timers #941

Open Sedictious opened 2 months ago

Sedictious commented 2 months ago

Currently the callback timers support a fixed timer type of uint32_t which fixes the resolution. I think it would be useful to add a template parameter to allow for configurable timer size.

I was thinking about adding something like timer_size along the lines of what is supported for etl::queue with memory_model which could default to uin32_t, thus not breaking any backwards compatibility. Would that be something of interest or is there any limiting factor I am missing?

jwellbelove commented 2 months ago

I'll take a look and see if it's viable.

Sedictious commented 2 months ago

@jwellbelove I am dealing with the change locally so it would be possible for me to clean up and and prepare a PR following the style of memory_model if it would help

jwellbelove commented 2 months ago

OK, give it a go. I'll be interested in what you come up with. Don't forget there are multiple timer classes.