rtic
rtic copied to clipboard
Change `timeout`/`delay` functions to non-async
Hi,
Because of a compiler bug, the async implementations of delay/delay_until/timeout/timeout_at produce much larger RAM footprint than they should. This was documented in #890.
This patch replaces those implementations with structs with Future implementations instead. On my current project, over three tasks, this saves 488(776->288) bytes over three tasks that used the delay and timeout functionality. As the target has only 8k of RAM, this was a significant saving.
All tests pass, but if someone could take an extra look at the Delay implementation to verify that it is indeed safe, that would be great. I've not done much work with unsafe Rust so it's new territory for me.
Best regards, Lasse
Might have to redo this one after #874 was merged ... :/ sorry for that.
Might have to redo this one after #874 was merged ... :/ sorry for that.
No worries, I've rebased on to latest master and updated.
Best regards, Lasse
Hi @dalegaard, sorry you were hit by a short moment of broken CI! Could you rebase on master again? It should make CI pass for you so we can get this merged :)
@korken89
Certainly, I've rebased it now.
Best regards, Lasse