Split embassy crate into embassy-executor, embassy-util.

This commit is contained in:
Dario Nieuwenhuis
2022-07-29 21:58:35 +02:00
parent 8745d646f0
commit a0f1b0ee01
319 changed files with 1159 additions and 998 deletions

View File

@ -7,7 +7,8 @@ version = "0.1.0"
crate-type = ["cdylib"]
[dependencies]
embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm", "nightly"] }
embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] }
embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly"] }
wasm-logger = "0.2.0"
wasm-bindgen = "0.2"

View File

@ -1,10 +1,10 @@
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
use embassy::executor::Spawner;
use embassy::time::{Duration, Timer};
use embassy_executor::executor::Spawner;
use embassy_executor::time::{Duration, Timer};
#[embassy::task]
#[embassy_executor::task]
async fn ticker() {
let window = web_sys::window().expect("no global `window` exists");
@ -24,7 +24,7 @@ async fn ticker() {
}
}
#[embassy::main]
#[embassy_executor::main]
async fn main(spawner: Spawner) {
wasm_logger::init(wasm_logger::Config::default());
spawner.spawn(ticker()).unwrap();