avr-rust / delay

arduino-like delay routines based on busy-wait loops
Apache License 2.0
15 stars 11 forks source link

Cycle accurate implementation #23

Closed bombela closed 2 years ago

bombela commented 2 years ago

I am looking at implementing a cycle accurate solution. Pretty much identical to what the gcc-avr intrinsic does. This was discussed in #17. Here is the code for reference: https://gist.github.com/bombela/cc90e5c29f3e7667326de4c087c1e148.

At the time of writing this, the implementation on master and rewrite are both not guaranteed to be expanded at compile time, and they are also not accurate.

Before I spend anytime working in this PR, I would like to know if you are interested in it. And if I should raise it against the rewrite branch.

stappersg commented 2 years ago

Against branch cycacc, that is currently equal to master branch.

Yes, do read that as there is interest in a cycle accurate solution. It is the pretty much identical to what the GCC-AVR intrinsic does what makes it appealling.

Branch rewrite was created for finding out "what is the actual change?", name is based on title "Rewrote library to fix several issues" of #17. Some how it does feel like "rewrite just because we can", I prefer "change for a reason".

bombela commented 2 years ago

Ok!