diff options
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/nrf/Cargo.toml | 3 | ||||
| -rw-r--r-- | examples/nrf/src/bin/mpsc.rs | 6 | ||||
| -rw-r--r-- | examples/nrf/src/bin/uart_split.rs | 6 | ||||
| -rw-r--r-- | examples/std/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/stm32f3/src/bin/button_events.rs | 11 | ||||
| -rw-r--r-- | examples/wasm/Cargo.toml | 2 |
6 files changed, 18 insertions, 12 deletions
diff --git a/examples/nrf/Cargo.toml b/examples/nrf/Cargo.toml index da16bcbaf..2d9c99530 100644 --- a/examples/nrf/Cargo.toml +++ b/examples/nrf/Cargo.toml | |||
| @@ -4,6 +4,9 @@ edition = "2018" | |||
| 4 | name = "embassy-nrf-examples" | 4 | name = "embassy-nrf-examples" |
| 5 | version = "0.1.0" | 5 | version = "0.1.0" |
| 6 | 6 | ||
| 7 | [features] | ||
| 8 | default = ["nightly"] | ||
| 9 | nightly = ["embassy-nrf/nightly"] | ||
| 7 | 10 | ||
| 8 | [dependencies] | 11 | [dependencies] |
| 9 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } | 12 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } |
diff --git a/examples/nrf/src/bin/mpsc.rs b/examples/nrf/src/bin/mpsc.rs index 454fb9541..d50736d82 100644 --- a/examples/nrf/src/bin/mpsc.rs +++ b/examples/nrf/src/bin/mpsc.rs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | 7 | ||
| 8 | use defmt::unwrap; | 8 | use defmt::unwrap; |
| 9 | use embassy::blocking_mutex::kind::Noop; | 9 | use embassy::blocking_mutex::raw::NoopRawMutex; |
| 10 | use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError}; | 10 | use embassy::channel::mpsc::{self, Channel, Sender, TryRecvError}; |
| 11 | use embassy::executor::Spawner; | 11 | use embassy::executor::Spawner; |
| 12 | use embassy::time::{Duration, Timer}; | 12 | use embassy::time::{Duration, Timer}; |
| @@ -19,10 +19,10 @@ enum LedState { | |||
| 19 | Off, | 19 | Off, |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | static CHANNEL: Forever<Channel<Noop, LedState, 1>> = Forever::new(); | 22 | static CHANNEL: Forever<Channel<NoopRawMutex, LedState, 1>> = Forever::new(); |
| 23 | 23 | ||
| 24 | #[embassy::task(pool_size = 1)] | 24 | #[embassy::task(pool_size = 1)] |
| 25 | async fn my_task(sender: Sender<'static, Noop, LedState, 1>) { | 25 | async fn my_task(sender: Sender<'static, NoopRawMutex, LedState, 1>) { |
| 26 | loop { | 26 | loop { |
| 27 | let _ = sender.send(LedState::On).await; | 27 | let _ = sender.send(LedState::On).await; |
| 28 | Timer::after(Duration::from_secs(1)).await; | 28 | Timer::after(Duration::from_secs(1)).await; |
diff --git a/examples/nrf/src/bin/uart_split.rs b/examples/nrf/src/bin/uart_split.rs index 750798378..19d438c40 100644 --- a/examples/nrf/src/bin/uart_split.rs +++ b/examples/nrf/src/bin/uart_split.rs | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | mod example_common; | 6 | mod example_common; |
| 7 | use example_common::*; | 7 | use example_common::*; |
| 8 | 8 | ||
| 9 | use embassy::blocking_mutex::kind::Noop; | 9 | use embassy::blocking_mutex::raw::NoopRawMutex; |
| 10 | use embassy::channel::mpsc::{self, Channel, Sender}; | 10 | use embassy::channel::mpsc::{self, Channel, Sender}; |
| 11 | use embassy::executor::Spawner; | 11 | use embassy::executor::Spawner; |
| 12 | use embassy::util::Forever; | 12 | use embassy::util::Forever; |
| @@ -14,7 +14,7 @@ use embassy_nrf::peripherals::UARTE0; | |||
| 14 | use embassy_nrf::uarte::UarteRx; | 14 | use embassy_nrf::uarte::UarteRx; |
| 15 | use embassy_nrf::{interrupt, uarte, Peripherals}; | 15 | use embassy_nrf::{interrupt, uarte, Peripherals}; |
| 16 | 16 | ||
| 17 | static CHANNEL: Forever<Channel<Noop, [u8; 8], 1>> = Forever::new(); | 17 | static CHANNEL: Forever<Channel<NoopRawMutex, [u8; 8], 1>> = Forever::new(); |
| 18 | 18 | ||
| 19 | #[embassy::main] | 19 | #[embassy::main] |
| 20 | async fn main(spawner: Spawner, p: Peripherals) { | 20 | async fn main(spawner: Spawner, p: Peripherals) { |
| @@ -56,7 +56,7 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | #[embassy::task] | 58 | #[embassy::task] |
| 59 | async fn reader(mut rx: UarteRx<'static, UARTE0>, s: Sender<'static, Noop, [u8; 8], 1>) { | 59 | async fn reader(mut rx: UarteRx<'static, UARTE0>, s: Sender<'static, NoopRawMutex, [u8; 8], 1>) { |
| 60 | let mut buf = [0; 8]; | 60 | let mut buf = [0; 8]; |
| 61 | loop { | 61 | loop { |
| 62 | info!("reading..."); | 62 | info!("reading..."); |
diff --git a/examples/std/Cargo.toml b/examples/std/Cargo.toml index 450911fa1..ef60fe992 100644 --- a/examples/std/Cargo.toml +++ b/examples/std/Cargo.toml | |||
| @@ -5,7 +5,7 @@ name = "embassy-std-examples" | |||
| 5 | version = "0.1.0" | 5 | version = "0.1.0" |
| 6 | 6 | ||
| 7 | [dependencies] | 7 | [dependencies] |
| 8 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "std", "time"] } | 8 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "std", "time", "nightly"] } |
| 9 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=["std", "log", "medium-ethernet", "tcp", "dhcpv4"] } | 9 | embassy-net = { version = "0.1.0", path = "../../embassy-net", features=["std", "log", "medium-ethernet", "tcp", "dhcpv4"] } |
| 10 | 10 | ||
| 11 | async-io = "1.6.0" | 11 | async-io = "1.6.0" |
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs index 720ed9d11..1218edd2b 100644 --- a/examples/stm32f3/src/bin/button_events.rs +++ b/examples/stm32f3/src/bin/button_events.rs | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #[path = "../example_common.rs"] | 13 | #[path = "../example_common.rs"] |
| 14 | mod example_common; | 14 | mod example_common; |
| 15 | use embassy::blocking_mutex::kind::Noop; | 15 | use embassy::blocking_mutex::raw::NoopRawMutex; |
| 16 | use embassy::channel::mpsc::{self, Channel, Receiver, Sender}; | 16 | use embassy::channel::mpsc::{self, Channel, Receiver, Sender}; |
| 17 | use embassy::executor::Spawner; | 17 | use embassy::executor::Spawner; |
| 18 | use embassy::time::{with_timeout, Duration, Timer}; | 18 | use embassy::time::{with_timeout, Duration, Timer}; |
| @@ -77,7 +77,7 @@ enum ButtonEvent { | |||
| 77 | Hold, | 77 | Hold, |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | static BUTTON_EVENTS_QUEUE: Forever<Channel<Noop, ButtonEvent, 4>> = Forever::new(); | 80 | static BUTTON_EVENTS_QUEUE: Forever<Channel<NoopRawMutex, ButtonEvent, 4>> = Forever::new(); |
| 81 | 81 | ||
| 82 | #[embassy::main] | 82 | #[embassy::main] |
| 83 | async fn main(spawner: Spawner, p: Peripherals) { | 83 | async fn main(spawner: Spawner, p: Peripherals) { |
| @@ -103,7 +103,10 @@ async fn main(spawner: Spawner, p: Peripherals) { | |||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | #[embassy::task] | 105 | #[embassy::task] |
| 106 | async fn led_blinker(mut leds: Leds<'static>, queue: Receiver<'static, Noop, ButtonEvent, 4>) { | 106 | async fn led_blinker( |
| 107 | mut leds: Leds<'static>, | ||
| 108 | queue: Receiver<'static, NoopRawMutex, ButtonEvent, 4>, | ||
| 109 | ) { | ||
| 107 | loop { | 110 | loop { |
| 108 | leds.blink().await; | 111 | leds.blink().await; |
| 109 | match queue.try_recv() { | 112 | match queue.try_recv() { |
| @@ -121,7 +124,7 @@ async fn led_blinker(mut leds: Leds<'static>, queue: Receiver<'static, Noop, But | |||
| 121 | #[embassy::task] | 124 | #[embassy::task] |
| 122 | async fn button_waiter( | 125 | async fn button_waiter( |
| 123 | mut button: ExtiInput<'static, PA0>, | 126 | mut button: ExtiInput<'static, PA0>, |
| 124 | queue: Sender<'static, Noop, ButtonEvent, 4>, | 127 | queue: Sender<'static, NoopRawMutex, ButtonEvent, 4>, |
| 125 | ) { | 128 | ) { |
| 126 | const DOUBLE_CLICK_DELAY: u64 = 250; | 129 | const DOUBLE_CLICK_DELAY: u64 = 250; |
| 127 | const HOLD_DELAY: u64 = 1000; | 130 | const HOLD_DELAY: u64 = 1000; |
diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index c6218a805..6750f6a6c 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml | |||
| @@ -8,7 +8,7 @@ version = "0.1.0" | |||
| 8 | crate-type = ["cdylib"] | 8 | crate-type = ["cdylib"] |
| 9 | 9 | ||
| 10 | [dependencies] | 10 | [dependencies] |
| 11 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm"] } | 11 | embassy = { version = "0.1.0", path = "../../embassy", features = ["log", "wasm", "nightly"] } |
| 12 | 12 | ||
| 13 | wasm-logger = "0.2.0" | 13 | wasm-logger = "0.2.0" |
| 14 | wasm-bindgen = "0.2" | 14 | wasm-bindgen = "0.2" |
