Skip to content

Commit

Permalink
remove the radio macros
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev committed Sep 7, 2023
1 parent 208857d commit 2cd80a4
Show file tree
Hide file tree
Showing 56 changed files with 61 additions and 113 deletions.
2 changes: 1 addition & 1 deletion examples-esp32/examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Ap, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/async_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn main() -> ! {
)
.unwrap();

let bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, bluetooth, ..) = peripherals.RADIO.split();

let timer_group0 = TimerGroup::new(
peripherals.TIMG0,
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> ! {

let mut debounce_cnt = 500;

let mut bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, mut bluetooth, ..) = peripherals.RADIO.split();

loop {
let connector = BleConnector::new(&init, &mut bluetooth);
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/coex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> ! {
)
.unwrap();

let (wifi, bluetooth) = examples_util::get_wifi_bluetooth!(peripherals);
let (wifi, bluetooth, ..) = peripherals.RADIO.split();

let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Ap).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Sta).unwrap();

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 @@ -81,7 +81,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
4 changes: 2 additions & 2 deletions examples-esp32/examples/esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let mut esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();

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

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32/examples/static_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Ap, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/async_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn main() -> ! {
)
.unwrap();

let bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, bluetooth, ..) = peripherals.RADIO.split();

let timer_group0 = TimerGroup::new(
peripherals.TIMG0,
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() -> ! {

let mut debounce_cnt = 500;

let mut bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, mut bluetooth, ..) = peripherals.RADIO.split();

loop {
let connector = BleConnector::new(&init, &mut bluetooth);
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Ap).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Sta).unwrap();

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 @@ -77,7 +77,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
4 changes: 2 additions & 2 deletions examples-esp32c2/examples/esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let mut esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();

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

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/static_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Ap, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/async_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn main() -> ! {
)
.unwrap();

let bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, bluetooth, ..) = peripherals.RADIO.split();

let timer_group0 = TimerGroup::new(
peripherals.TIMG0,
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() -> ! {

let mut debounce_cnt = 500;

let mut bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, mut bluetooth, ..) = peripherals.RADIO.split();

loop {
let connector = BleConnector::new(&init, &mut bluetooth);
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/coex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn main() -> ! {
)
.unwrap();

let (wifi, bluetooth) = examples_util::get_wifi_bluetooth!(peripherals);
let (wifi, bluetooth, ..) = peripherals.RADIO.split();

let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Ap).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Sta).unwrap();

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 @@ -77,7 +77,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
4 changes: 2 additions & 2 deletions examples-esp32c3/examples/esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let mut esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();

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

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/static_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Ap, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/async_ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn main() -> ! {
)
.unwrap();

let bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, bluetooth, ..) = peripherals.RADIO.split();

let timer_group0 = TimerGroup::new(
peripherals.TIMG0,
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/ble.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fn main() -> ! {

let mut debounce_cnt = 500;

let mut bluetooth = examples_util::get_bluetooth!(peripherals);
let (_, mut bluetooth, ..) = peripherals.RADIO.split();

loop {
let connector = BleConnector::new(&init, &mut bluetooth);
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Ap).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Sta).unwrap();

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 @@ -77,7 +77,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
4 changes: 2 additions & 2 deletions examples-esp32c6/examples/esp_now.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let mut esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
let (wifi, ..) = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();

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

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/static_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let (wifi, ..) = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let wifi = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Ap, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let wifi = peripherals.RADIO.split();
let mut socket_set_entries: [SocketStorage; 3] = Default::default();
let (iface, device, mut controller, sockets) =
create_network_interface(&init, wifi, WifiMode::Sta, &mut socket_set_entries).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let wifi = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Ap).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let wifi = peripherals.RADIO.split();
let (wifi_interface, controller) =
esp_wifi::wifi::new_with_mode(&init, wifi, WifiMode::Sta).unwrap();

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 @@ -82,7 +82,7 @@ fn main() -> ! {
)
.unwrap();

let wifi = examples_util::get_wifi!(peripherals);
let wifi = peripherals.RADIO.split();
let esp_now = esp_wifi::esp_now::EspNow::new(&init, wifi).unwrap();
println!("esp-now version {}", esp_now.get_version().unwrap());

Expand Down
Loading

0 comments on commit 2cd80a4

Please sign in to comment.