Skip to content

Commit

Permalink
chore(build): bump Rust toolchain (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 authored Sep 17, 2024
2 parents 0c24d1d + f12cee7 commit c8f48bc
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
36 changes: 22 additions & 14 deletions examples/embassy-http-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand All @@ -43,7 +38,27 @@ impl picoserve::extract::FromRef<AppState> for ButtonInputs {
}
}

type AppRouter = impl picoserve::routing::PathRouter<AppState>;
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<AppState>;

pub fn make_app() -> picoserve::Router<AppRouter, AppState> {
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;

Expand Down Expand Up @@ -105,13 +120,6 @@ fn main(spawner: Spawner, peripherals: pins::Peripherals) {
ButtonInputs(BUTTON_INPUTS.init_with(|| Mutex::new(buttons)))
};

fn make_app() -> picoserve::Router<AppRouter, AppState> {
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<picoserve::Router<AppRouter, AppState>> = StaticCell::new();
let app = APP.init_with(|| make_app());

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/lib/coapcore/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-embassy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-nrf/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![no_std]
#![feature(doc_auto_cfg)]
#![feature(lint_reasons)]

pub mod gpio;

Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-rp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-runqueue/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![cfg_attr(not(test), no_std)]
#![feature(lint_reasons)]

mod runqueue;
pub use runqueue::{RunQueue, RunqueueId, ThreadId};
Expand Down
1 change: 0 additions & 1 deletion src/riot-rs-threads/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down

0 comments on commit c8f48bc

Please sign in to comment.