diff --git a/Cargo.lock b/Cargo.lock index 2ad63388e..4cc0303b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -583,6 +583,12 @@ dependencies = [ "syn 2.0.46", ] +[[package]] +name = "data-encoding" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" + [[package]] name = "debug-helper" version = "0.3.13" @@ -727,6 +733,25 @@ dependencies = [ "num-traits", ] +[[package]] +name = "embassy-http-server" +version = "0.1.0" +dependencies = [ + "embassy-executor", + "embassy-net", + "embassy-nrf", + "embassy-sync", + "embassy-time", + "embedded-io-async", + "httparse", + "linkme", + "picoserve", + "riot-rs", + "riot-rs-boards", + "serde", + "static_cell", +] + [[package]] name = "embassy-net" version = "0.3.0" @@ -1269,6 +1294,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" dependencies = [ "hash32 0.3.1", + "serde", "stable_deref_trait", ] @@ -1317,6 +1343,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + [[package]] name = "ident_case" version = "1.0.1" @@ -1418,6 +1450,12 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16187c4751af0c33941a689f3e922132b165729cfaa73f592fe5cce7393e9f0c" +[[package]] +name = "lhash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744a4c881f502e98c2241d2e5f50040ac73b30194d64452bb6260393b53f0dc9" + [[package]] name = "libc" version = "0.2.151" @@ -1890,6 +1928,22 @@ dependencies = [ "siphasher", ] +[[package]] +name = "picoserve" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab20855a694e13dddfd360685e5bc78fb28cef2581237e6c83f91c79a59aa6da" +dependencies = [ + "data-encoding", + "embedded-io-async", + "futures-util", + "heapless 0.8.0", + "lhash", + "log", + "ryu", + "serde", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -2137,9 +2191,9 @@ dependencies = [ "riot-build", "riot-rs-boards", "riot-rs-buildinfo", - "riot-rs-core", "riot-rs-embassy", "riot-rs-rt", + "riot-rs-threads", ] [[package]] diff --git a/examples/application/src/main.rs b/examples/application/src/main.rs index 0a6c06803..f5e3bfcee 100644 --- a/examples/application/src/main.rs +++ b/examples/application/src/main.rs @@ -27,8 +27,3 @@ impl Application for MyApplication { } riot_rs::embassy::riot_initialize!(MyApplication); - -#[no_mangle] -fn riot_main() { - riot_rs::rt::debug::exit(Ok(())) -} diff --git a/examples/benchmark/Cargo.toml b/examples/benchmark/Cargo.toml index 99e28d01e..a25b7d07b 100644 --- a/examples/benchmark/Cargo.toml +++ b/examples/benchmark/Cargo.toml @@ -7,5 +7,5 @@ edition = "2021" publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs" } +riot-rs = { path = "../../src/riot-rs", features = [ "threading" ] } riot-rs-boards = { path = "../../src/riot-rs-boards" } diff --git a/examples/core-sizes/Cargo.toml b/examples/core-sizes/Cargo.toml index afde4fe6a..f7ce73028 100644 --- a/examples/core-sizes/Cargo.toml +++ b/examples/core-sizes/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs" } +riot-rs = { path = "../../src/riot-rs", features = [ "threading" ] } riot-rs-boards = { path = "../../src/riot-rs-boards" } diff --git a/examples/embassy-http-server/src/main.rs b/examples/embassy-http-server/src/main.rs index 732fce388..3899c96a7 100644 --- a/examples/embassy-http-server/src/main.rs +++ b/examples/embassy-http-server/src/main.rs @@ -163,13 +163,3 @@ impl Application for WebServer { } riot_rs::embassy::riot_initialize!(WebServer); - -#[no_mangle] -fn riot_main() { - println!( - "Hello from riot_main()! Running on a {} board.", - riot_rs::buildinfo::BOARD - ); - - loop {} -} diff --git a/examples/embassy-net-tcp/src/main.rs b/examples/embassy-net-tcp/src/main.rs index 4ab336eeb..f51a330f2 100644 --- a/examples/embassy-net-tcp/src/main.rs +++ b/examples/embassy-net-tcp/src/main.rs @@ -72,13 +72,3 @@ impl Application for TcpEcho { } riot_rs::embassy::riot_initialize!(TcpEcho); - -#[no_mangle] -fn riot_main() { - println!( - "Hello from riot_main()! Running on a {} board.", - riot_rs::buildinfo::BOARD - ); - - loop {} -} diff --git a/examples/embassy-net-udp/src/main.rs b/examples/embassy-net-udp/src/main.rs index 91dbe1498..122c66bb6 100644 --- a/examples/embassy-net-udp/src/main.rs +++ b/examples/embassy-net-udp/src/main.rs @@ -77,13 +77,3 @@ impl Application for UdpEcho { } riot_rs::embassy::riot_initialize!(UdpEcho); - -#[no_mangle] -fn riot_main() { - println!( - "Hello from riot_main()! Running on a {} board.", - riot_rs::buildinfo::BOARD - ); - - loop {} -} diff --git a/examples/embassy/Cargo.toml b/examples/embassy/Cargo.toml index 5c5adcad7..7a75af76b 100644 --- a/examples/embassy/Cargo.toml +++ b/examples/embassy/Cargo.toml @@ -6,7 +6,7 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs", features = ["time"] } +riot-rs = { path = "../../src/riot-rs", features = [ "threading", "time"] } riot-rs-boards = { path = "../../src/riot-rs-boards" } embassy-executor = { workspace = true, default-features = false } embassy-time = { workspace = true, default-features = false } diff --git a/examples/hello-world/Cargo.toml b/examples/hello-world/Cargo.toml index 1583c6b94..6c3c9cbb2 100644 --- a/examples/hello-world/Cargo.toml +++ b/examples/hello-world/Cargo.toml @@ -6,6 +6,6 @@ edition.workspace = true publish = false [dependencies] -riot-rs = { path = "../../src/riot-rs" } +riot-rs = { path = "../../src/riot-rs", features = [ "threading" ] } riot-rs-boards = { path = "../../src/riot-rs-boards" } riot-wrappers = { workspace = true, optional = true }