Add WASM support for executor

* Adds an executor for WASM runtimes based on wasm_bindgen.
* Add time driver based on JS time handling.
* Add example that can run in browser locally.
* Update to critical-section version that supports 'std' flag
This commit is contained in:
Ulf Lilleengen
2021-09-13 14:35:40 +02:00
parent f1c35b40c7
commit e24528051b
18 changed files with 414 additions and 8 deletions

17
examples/wasm/Cargo.toml Normal file
View File

@ -0,0 +1,17 @@
[package]
authors = ["Ulf Lilleengen <lulf@redhat.com>"]
edition = "2018"
name = "embassy-wasm-example"
version = "0.1.0"
[lib]
crate-type = ["cdylib"]
[dependencies]
embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm"] }
wasm-logger = "0.2.0"
wasm-bindgen = "0.2"
web-sys = { version = "0.3", features = ["Document", "Element", "HtmlElement", "Node", "Window" ] }
log = "0.4.11"
critical-section = "0.2.2"