diff --git a/Cargo.lock b/Cargo.lock index d68143696..660ec2242 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1127,7 +1127,7 @@ dependencies = [ [[package]] name = "embassy-executor" version = "0.6.0" -source = "git+https://github.com/kaspar030/embassy?branch=for-riot-rs-2024-08-18#164b3a99efbeccc442971b63dc1b90f03db637ea" +source = "git+https://github.com/kaspar030/embassy?branch=for-riot-rs-2024-08-18-wakers#c17dc6cc90d6b9e8c18c8b0ea58c1a4dd868b6f1" dependencies = [ "cortex-m", "critical-section", diff --git a/Cargo.toml b/Cargo.toml index 392f3db1e..aa5a5a6bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,7 +117,7 @@ opt-level = 3 [patch.crates-io] # riot-rs embassy fork -embassy-executor = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-2024-08-18" } +embassy-executor = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-2024-08-18-wakers" } embassy-hal-internal = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-2024-08-18" } embassy-nrf = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-2024-08-18" } embassy-net = { git = "https://github.com/kaspar030/embassy", branch = "for-riot-rs-2024-08-18" } diff --git a/examples/embassy-http-server/src/main.rs b/examples/embassy-http-server/src/main.rs index 89bf1baed..a918c3ba0 100644 --- a/examples/embassy-http-server/src/main.rs +++ b/examples/embassy-http-server/src/main.rs @@ -11,16 +11,11 @@ use riot_rs::{debug::log::*, network, ConstStaticCell, Spawner, StaticCell}; use embassy_net::tcp::TcpSocket; use embassy_time::Duration; -use picoserve::{io::Error, routing::get}; +use picoserve::io::Error; #[cfg(feature = "button-readings")] use embassy_nrf::gpio::{Input, Pin, Pull}; -struct AppState { - #[cfg(feature = "button-readings")] - buttons: ButtonInputs, -} - #[cfg(feature = "button-readings")] use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex}; @@ -43,7 +38,27 @@ impl picoserve::extract::FromRef for ButtonInputs { } } -type AppRouter = impl picoserve::routing::PathRouter; +mod approuter { + use picoserve::routing::get; + + use crate::routes; + + pub struct AppState { + #[cfg(feature = "button-readings")] + pub buttons: crate::ButtonInputs, + } + + pub type AppRouter = impl picoserve::routing::PathRouter; + + pub fn make_app() -> picoserve::Router { + let router = picoserve::Router::new().route("/", get(routes::index)); + #[cfg(feature = "button-readings")] + let router = router.route("/buttons", get(routes::buttons)); + router + } +} + +use approuter::*; const WEB_TASK_POOL_SIZE: usize = 2; @@ -105,13 +120,6 @@ fn main(spawner: Spawner, peripherals: pins::Peripherals) { ButtonInputs(BUTTON_INPUTS.init_with(|| Mutex::new(buttons))) }; - fn make_app() -> picoserve::Router { - let router = picoserve::Router::new().route("/", get(routes::index)); - #[cfg(feature = "button-readings")] - let router = router.route("/buttons", get(routes::buttons)); - router - } - static APP: StaticCell> = StaticCell::new(); let app = APP.init_with(|| make_app()); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8b844ce81..7f6d383b4 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ # this file is parsed with grep & sed for parsing out the actual toolchain # from the "channel" line. Please keep that in mind when modifying. [toolchain] -channel = "nightly-2024-05-20" +channel = "nightly-2024-09-16" targets = [ "thumbv6m-none-eabi", "thumbv7m-none-eabi", diff --git a/src/lib/coapcore/src/lib.rs b/src/lib/coapcore/src/lib.rs index 206321d3b..049a19300 100644 --- a/src/lib/coapcore/src/lib.rs +++ b/src/lib/coapcore/src/lib.rs @@ -10,7 +10,6 @@ //! for at least as long as the OSCORE component is tightly coupled to a particular implementation //! of [`coap-message`]). #![no_std] -#![feature(lint_reasons)] // Might warrant a standalone crate at some point // diff --git a/src/riot-rs-embassy/src/lib.rs b/src/riot-rs-embassy/src/lib.rs index 05612875d..32bad2ed3 100644 --- a/src/riot-rs-embassy/src/lib.rs +++ b/src/riot-rs-embassy/src/lib.rs @@ -3,7 +3,6 @@ #![no_std] #![feature(impl_trait_in_assoc_type)] #![feature(used_with_arg)] -#![feature(lint_reasons)] #![feature(doc_auto_cfg)] pub mod define_peripherals; diff --git a/src/riot-rs-nrf/src/lib.rs b/src/riot-rs-nrf/src/lib.rs index dfc9e3f12..c8d57a4a6 100644 --- a/src/riot-rs-nrf/src/lib.rs +++ b/src/riot-rs-nrf/src/lib.rs @@ -1,6 +1,5 @@ #![no_std] #![feature(doc_auto_cfg)] -#![feature(lint_reasons)] pub mod gpio; diff --git a/src/riot-rs-rp/src/lib.rs b/src/riot-rs-rp/src/lib.rs index 97f7385ea..42a52b9e5 100644 --- a/src/riot-rs-rp/src/lib.rs +++ b/src/riot-rs-rp/src/lib.rs @@ -2,7 +2,6 @@ #![feature(doc_auto_cfg)] #![feature(impl_trait_in_assoc_type)] #![feature(type_alias_impl_trait)] -#![feature(lint_reasons)] pub mod gpio; diff --git a/src/riot-rs-runqueue/src/lib.rs b/src/riot-rs-runqueue/src/lib.rs index adecd51ce..54615508d 100644 --- a/src/riot-rs-runqueue/src/lib.rs +++ b/src/riot-rs-runqueue/src/lib.rs @@ -1,5 +1,4 @@ #![cfg_attr(not(test), no_std)] -#![feature(lint_reasons)] mod runqueue; pub use runqueue::{RunQueue, RunqueueId, ThreadId}; diff --git a/src/riot-rs-threads/src/lib.rs b/src/riot-rs-threads/src/lib.rs index 1be7e344b..ad3775a11 100644 --- a/src/riot-rs-threads/src/lib.rs +++ b/src/riot-rs-threads/src/lib.rs @@ -1,7 +1,6 @@ #![cfg_attr(not(test), no_std)] #![feature(naked_functions)] #![feature(used_with_arg)] -#![feature(lint_reasons)] // Disable indexing lints for now, possible panics are documented or rely on internally-enforced // invariants #![allow(clippy::indexing_slicing)]