Remove Forever, switch to static_cell.

This commit is contained in:
Dario Nieuwenhuis
2022-08-22 15:51:44 +02:00
parent 1b95990258
commit 478f472784
45 changed files with 139 additions and 220 deletions

View File

@ -8,7 +8,7 @@ use defmt::*;
use embassy_executor::raw::TaskStorage;
use embassy_executor::Executor;
use embassy_time::{Duration, Timer};
use embassy_util::Forever;
use static_cell::StaticCell;
use {defmt_rtt as _, panic_probe as _};
async fn run1() {
@ -25,14 +25,14 @@ async fn run2() {
}
}
static EXECUTOR: Forever<Executor> = Forever::new();
static EXECUTOR: StaticCell<Executor> = StaticCell::new();
#[entry]
fn main() -> ! {
info!("Hello World!");
let _p = embassy_stm32::init(Default::default());
let executor = EXECUTOR.put(Executor::new());
let executor = EXECUTOR.init(Executor::new());
let run1_task = TaskStorage::new();
let run2_task = TaskStorage::new();