From 98d2af9d73da56910c8bb6cb662fbc4d609a704a Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Wed, 7 Jul 2021 22:50:59 +0200 Subject: Fixing tests --- examples/pool.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'examples/pool.rs') 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)] -- cgit v1.2.3