Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Mar 28, 2023
1 parent 115d5d3 commit 2611ca0
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 138 deletions.
100 changes: 0 additions & 100 deletions esp-wifi/examples/esp_now.rs

This file was deleted.

6 changes: 3 additions & 3 deletions examples-esp32/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand All @@ -111,12 +111,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand Down Expand Up @@ -119,12 +119,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::{embassy, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}
use hal::system::SystemExt;

#[embassy_executor::task]
async fn run(mut esp_now: EspNow) {
async fn run(mut esp_now: EspNow<'static>) {
let mut ticker = Ticker::every(Duration::from_secs(5));
loop {
let res = select(ticker.next(), async {
Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand All @@ -111,12 +111,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand Down Expand Up @@ -119,12 +119,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::{embassy, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}
use hal::system::SystemExt;

#[embassy_executor::task]
async fn run(mut esp_now: EspNow) {
async fn run(mut esp_now: EspNow<'static>) {
let mut ticker = Ticker::every(Duration::from_secs(5));
loop {
let res = select(ticker.next(), async {
Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c3/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand All @@ -111,12 +111,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c3/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand Down Expand Up @@ -119,12 +119,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::{embassy, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}
use hal::system::SystemExt;

#[embassy_executor::task]
async fn run(mut esp_now: EspNow) {
async fn run(mut esp_now: EspNow<'static>) {
let mut ticker = Ticker::every(Duration::from_secs(5));
loop {
let res = select(ticker.next(), async {
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn main() -> ! {
.unwrap();

let (wifi, _) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(wifi).unwrap();
let mut esp_now = esp_wifi::esp_now::EspNow::new(wifi).unwrap();

println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c6/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand All @@ -111,12 +111,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32c6/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand Down Expand Up @@ -119,12 +119,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::{embassy, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}
use hal::system::SystemExt;

#[embassy_executor::task]
async fn run(mut esp_now: EspNow) {
async fn run(mut esp_now: EspNow<'static>) {
let mut ticker = Ticker::every(Duration::from_secs(5));
loop {
let res = select(ticker.next(), async {
Expand Down
6 changes: 3 additions & 3 deletions examples-esp32s2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand All @@ -111,12 +111,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
6 changes: 3 additions & 3 deletions examples-esp32s2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn main() -> ! {
}

#[embassy_executor::task]
async fn connection(mut controller: WifiController) {
async fn connection(mut controller: WifiController<'static>) {
println!("start connection task");
println!("Device capabilities: {:?}", controller.get_capabilities());
loop {
Expand Down Expand Up @@ -119,12 +119,12 @@ async fn connection(mut controller: WifiController) {
}

#[embassy_executor::task]
async fn net_task(stack: &'static Stack<WifiDevice>) {
async fn net_task(stack: &'static Stack<WifiDevice<'static>>) {
stack.run().await
}

#[embassy_executor::task]
async fn task(stack: &'static Stack<WifiDevice>) {
async fn task(stack: &'static Stack<WifiDevice<'static>>) {
let mut rx_buffer = [0; 4096];
let mut tx_buffer = [0; 4096];

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hal::{embassy, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc}
use hal::system::SystemExt;

#[embassy_executor::task]
async fn run(mut esp_now: EspNow) {
async fn run(mut esp_now: EspNow<'static>) {
let mut ticker = Ticker::every(Duration::from_secs(5));
loop {
let res = select(ticker.next(), async {
Expand Down
Loading

0 comments on commit 2611ca0

Please sign in to comment.