Skip to content

Commit

Permalink
examples/embassy-http-server: update for changed embassy Pin API
Browse files Browse the repository at this point in the history
  • Loading branch information
kaspar030 committed Jan 25, 2024
1 parent 9e16c9a commit f60c70b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/embassy-http-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use riot_rs::embassy::{
use riot_rs::rt::debug::println;

use embassy_net::tcp::TcpSocket;
use embassy_nrf::gpio::{AnyPin, Input, Pin, Pull};
use embassy_nrf::gpio::{Input, Pin, Pull};
use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, mutex::Mutex};
use embassy_time::Duration;
use picoserve::routing::get;
Expand Down Expand Up @@ -44,10 +44,10 @@ struct AppState {
struct ButtonInputs(&'static Mutex<CriticalSectionRawMutex, Buttons>);

struct Buttons {
button1: Input<'static, AnyPin>,
button2: Input<'static, AnyPin>,
button3: Input<'static, AnyPin>,
button4: Input<'static, AnyPin>,
button1: Input<'static>,
button2: Input<'static>,
button3: Input<'static>,
button4: Input<'static>,
}

impl picoserve::extract::FromRef<AppState> for ButtonInputs {
Expand Down
2 changes: 1 addition & 1 deletion examples/embassy-http-server/src/routes/buttons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use picoserve::{
use crate::ButtonInputs;

pub async fn buttons(State(ButtonInputs(button_inputs)): State<ButtonInputs>) -> impl IntoResponse {
let mut buttons = button_inputs.lock().await;
let buttons = button_inputs.lock().await;

Json(JsonButtons {
button1: buttons.button1.is_low(),
Expand Down

0 comments on commit f60c70b

Please sign in to comment.