Executor API V2.
- It's no longer possible to call run() reentrantly from within a task (soundness issue) - it's now possible to spawn Send tasks across threads (SendSpawner, #37)
This commit is contained in:
@ -49,11 +49,8 @@ fn main() -> ! {
|
||||
let dp = stm32::Peripherals::take().unwrap();
|
||||
let cp = cortex_m::peripheral::Peripherals::take().unwrap();
|
||||
|
||||
let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev));
|
||||
executor.spawn(run(dp, cp)).unwrap();
|
||||
|
||||
loop {
|
||||
executor.run();
|
||||
//cortex_m::asm::wfe(); // wfe causes RTT to stop working on stm32
|
||||
}
|
||||
let executor = EXECUTOR.put(Executor::new());
|
||||
executor.run(|spawner| {
|
||||
unwrap!(spawner.spawn(run(dp, cp)));
|
||||
});
|
||||
}
|
||||
|
@ -59,11 +59,8 @@ fn main() -> ! {
|
||||
let dp = stm32::Peripherals::take().unwrap();
|
||||
let cp = cortex_m::peripheral::Peripherals::take().unwrap();
|
||||
|
||||
let executor = EXECUTOR.put(Executor::new(cortex_m::asm::sev));
|
||||
executor.spawn(run(dp, cp)).unwrap();
|
||||
|
||||
loop {
|
||||
executor.run();
|
||||
//cortex_m::asm::wfe(); // wfe causes RTT to stop working on stm32
|
||||
}
|
||||
let executor = EXECUTOR.put(Executor::new());
|
||||
executor.run(|spawner| {
|
||||
unwrap!(spawner.spawn(run(dp, cp)));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user