aboutsummaryrefslogtreecommitdiff
path: root/examples/type-usage.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-20 13:58:22 +0000
committerGitHub <noreply@github.com>2021-04-20 13:58:22 +0000
commitf586c3c5a8a14e37d69d229fd6e69459a6074cc4 (patch)
tree194d5268b165f21c925fb4523a67233c33c2bba5 /examples/type-usage.rs
parentb8b13573aebfa6719e25f0e2c8b1c28cdb66301a (diff)
parentbc10fe266d7a3fbae0235cee23d62f75877bf6c4 (diff)
Merge #476
476: reclaim stack space used in late init r=korken89 a=conorpp Fixes #474. Tested that there is no longer any stack overhead leftover from moving init resources. (made mistake force pushing with last PR when trying to fix lint) The expansion for an example with 2 buffers as resources changes from: ```rust let (late, mut monotonics) = crate::APP::init(init::Context::new(core.into())); __rtic_internal_mybuffer.as_mut_ptr().write(late.mybuffer); __rtic_internal_mybuffer2.as_mut_ptr().write(late.mybuffer2); rtic::export::interrupt::enable(); crate::APP::idle(idle::Context::new(&rtic::export::Priority::new(0))) ``` to: ```rust #[inline(never)] fn __rtic_init_resources<F>(f: F) where F: FnOnce(), { f(); } __rtic_init_resources(|| { let (late, mut monotonics) = crate::APP::init(init::Context::new(core.into())); __rtic_internal_mybuffer.as_mut_ptr().write(late.mybuffer); __rtic_internal_mybuffer2.as_mut_ptr().write(late.mybuffer2); rtic::export::interrupt::enable(); }); crate::APP::idle(idle::Context::new(&rtic::export::Priority::new(0))) ``` Co-authored-by: Conor Patrick <conorpp94@gmail.com>
Diffstat (limited to 'examples/type-usage.rs')
0 files changed, 0 insertions, 0 deletions