Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HAL cleanups & remove example macros #261

Merged
merged 8 commits into from
Sep 7, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove the radio macros
  • Loading branch information
MabezDev committed Sep 7, 2023
commit 2cd80a48b65631d8ca2d5b7664c0120daa765c22
2 changes: 1 addition & 1 deletion examples-esp32/examples/access_point.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32/examples/async_ble.rs
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion examples-esp32/examples/ble.rs
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion examples-esp32/examples/coex.rs
Original file line number Diff line number Diff line change
@@ -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) =
2 changes: 1 addition & 1 deletion examples-esp32/examples/dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

4 changes: 2 additions & 2 deletions examples-esp32/examples/esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

2 changes: 1 addition & 1 deletion examples-esp32/examples/static_ip.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/access_point.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/async_ble.rs
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/ble.rs
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c2/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

4 changes: 2 additions & 2 deletions examples-esp32c2/examples/esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

2 changes: 1 addition & 1 deletion examples-esp32c2/examples/static_ip.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/access_point.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/async_ble.rs
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/ble.rs
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/coex.rs
Original file line number Diff line number Diff line change
@@ -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) =
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c3/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

4 changes: 2 additions & 2 deletions examples-esp32c3/examples/esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

2 changes: 1 addition & 1 deletion examples-esp32c3/examples/static_ip.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/access_point.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/async_ble.rs
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/ble.rs
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32c6/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

4 changes: 2 additions & 2 deletions examples-esp32c6/examples/esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

2 changes: 1 addition & 1 deletion examples-esp32c6/examples/static_ip.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/access_point.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();
2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_access_point.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_dhcp.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion examples-esp32s2/examples/embassy_esp_now.rs
Original file line number Diff line number Diff line change
@@ -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());

Loading