diff options
| author | Emil Fresk <emil.fresk@gmail.com> | 2021-07-07 22:50:59 +0200 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2021-07-07 23:07:09 +0200 |
| commit | 98d2af9d73da56910c8bb6cb662fbc4d609a704a (patch) | |
| tree | 46914250a980b9164b2d20cbeb08e126a86cf7ea /examples/pool.rs | |
| parent | 633012190baa0801efc7e3ab2f699778c5038d54 (diff) | |
Fixing tests
Diffstat (limited to 'examples/pool.rs')
| -rw-r--r-- | examples/pool.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/pool.rs b/examples/pool.rs index 44405b4..63be899 100644 --- a/examples/pool.rs +++ b/examples/pool.rs @@ -24,16 +24,20 @@ mod app { // Import the memory pool into scope use super::P; - #[init] - fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { - static mut MEMORY: [u8; 512] = [0; 512]; + #[shared] + struct Shared {} + #[local] + struct Local {} + + #[init(local = [memory: [u8; 512] = [0; 512]])] + fn init(cx: init::Context) -> (Shared, Local, init::Monotonics) { // Increase the capacity of the memory pool by ~4 - P::grow(MEMORY); + P::grow(cx.local.memory); rtic::pend(Interrupt::I2C0); - (init::LateResources {}, init::Monotonics()) + (Shared {}, Local {}, init::Monotonics()) } #[task(binds = I2C0, priority = 2)] |
