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

@ -29,3 +29,4 @@ panic-probe = { version = "0.3", features = ["print-defmt"] }
futures = { version = "0.3.17", default-features = false, features = ["async-await"] }
heapless = { version = "0.7.5", default-features = false }
embedded-hal = "0.2.6"
static_cell = "1.0"

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();