Merge pull request #1 from mriise/const

fix pool example
This commit is contained in:
Zgarbul Andrey 2021-07-20 11:38:06 +03:00 committed by GitHub
commit 5153ff1715
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,14 +42,14 @@ mod app {
#[task(binds = I2C0, priority = 2)] #[task(binds = I2C0, priority = 2)]
fn i2c0(_: i2c0::Context) { fn i2c0(_: i2c0::Context) {
// claim a memory block, leave it uninitialized and .. // claim a memory block, initialize it and ..
let x = P::alloc().unwrap().freeze(); let x = P::alloc().unwrap().init([0u8; 128]);
// .. send it to the `foo` task // .. send it to the `foo` task
foo::spawn(x).ok().unwrap(); foo::spawn(x).ok().unwrap();
// send another block to the task `bar` // send another block to the task `bar`
bar::spawn(P::alloc().unwrap().freeze()).ok().unwrap(); bar::spawn(P::alloc().unwrap().init([0u8; 128])).ok().unwrap();
} }
#[task] #[task]