Closed seanybaggins closed 3 years ago
Hi this is to get compile time generation and optimization of the conversion math.
To set the speed of a HAL timer at compile time you can see an example here: https://github.com/rtic-rs/dwt-systick-monotonic/blob/master/src/lib.rs
Thanks for the explanation. Closed the issue.
Why does the
Clock
Trait require the user to define...?
Would it be better if
const SCALING_FACTOR
was insteadThe rational Suppose I am writing some
hal
or driver and I would like to implement theClock
trait so the user of myhal
or driver doesn't need to. Its possible when writing thesehal
's or drivers that I cannot determine the frequency of hardware I am interfacing with at compile time but can determine the frequency at runtime.Example of how this may be implemented for a
hal
or driverI am still somewhat new to rust in an embedded context so my apologies if this is a horribly misguided suggestion/question.