aboutsummaryrefslogtreecommitdiff
path: root/examples/pool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pool.rs')
-rw-r--r--examples/pool.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/examples/pool.rs b/examples/pool.rs
index 44405b49..63be899e 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)]