diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-29 21:58:35 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-29 23:40:36 +0200 |
| commit | a0f1b0ee01d461607660d2d56b5b1bdc57e0d3fb (patch) | |
| tree | e60fc8f8db8ec07e55d655c1a830b07f4db0b7d2 /examples/wasm | |
| parent | 8745d646f0976791b7098456aa61adb983fb1c18 (diff) | |
Split embassy crate into embassy-executor, embassy-util.
Diffstat (limited to 'examples/wasm')
| -rw-r--r-- | examples/wasm/Cargo.toml | 3 | ||||
| -rw-r--r-- | examples/wasm/src/lib.rs | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index 347252fa3..4e26f023c 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -7,7 +7,8 @@ version = "0.1.0" | |||
| 7 | crate-type = ["cdylib"] | 7 | crate-type = ["cdylib"] |
| 8 | 8 | ||
| 9 | [dependencies] | 9 | [dependencies] |
| 10 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm", "nightly"] } | 10 | embassy-util = { version = "0.1.0", path = "../../embassy-util", features = ["log"] } |
| 11 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["log", "wasm", "nightly"] } | ||
| 11 | 12 | ||
| 12 | wasm-logger = "0.2.0" | 13 | wasm-logger = "0.2.0" |
| 13 | wasm-bindgen = "0.2" | 14 | wasm-bindgen = "0.2" |
diff --git a/examples/wasm/src/lib.rs b/examples/wasm/src/lib.rs index 61757ebd7..2e961e65a 100644 --- a/examples/wasm/src/lib.rs +++ b/examples/wasm/src/lib.rs | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | #![feature(type_alias_impl_trait)] | 1 | #![feature(type_alias_impl_trait)] |
| 2 | #![allow(incomplete_features)] | 2 | #![allow(incomplete_features)] |
| 3 | 3 | ||
| 4 | use embassy::executor::Spawner; | 4 | use embassy_executor::executor::Spawner; |
| 5 | use embassy::time::{Duration, Timer}; | 5 | use embassy_executor::time::{Duration, Timer}; |
| 6 | 6 | ||
| 7 | #[embassy::task] | 7 | #[embassy_executor::task] |
| 8 | async fn ticker() { | 8 | async fn ticker() { |
| 9 | let window = web_sys::window().expect("no global `window` exists"); | 9 | let window = web_sys::window().expect("no global `window` exists"); |
| 10 | 10 | ||
| @@ -24,7 +24,7 @@ async fn ticker() { | |||
| 24 | } | 24 | } |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | #[embassy::main] | 27 | #[embassy_executor::main] |
| 28 | async fn main(spawner: Spawner) { | 28 | async fn main(spawner: Spawner) { |
| 29 | wasm_logger::init(wasm_logger::Config::default()); | 29 | wasm_logger::init(wasm_logger::Config::default()); |
| 30 | spawner.spawn(ticker()).unwrap(); | 30 | spawner.spawn(ticker()).unwrap(); |
