Skip to content

Commit

Permalink
Change imports
Browse files Browse the repository at this point in the history
  • Loading branch information
torkleyy committed Aug 31, 2023
1 parent 917aaef commit 9ba46fa
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
4 changes: 1 addition & 3 deletions examples/eth.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported

#[cfg(esp32)]
use esp_idf_svc::{
eth::{BlockingEth, EspEth, EthDriver},
Expand All @@ -12,7 +10,7 @@ use log::info;

#[cfg(esp32)]
fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

let peripherals = Peripherals::take().unwrap();
Expand Down
6 changes: 3 additions & 3 deletions examples/http_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ use embedded_svc::{
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::http::client::EspHttpConnection;
use esp_idf_svc::log::EspLogger;
use esp_idf_svc::sys::{self as _};
use esp_idf_svc::wifi::{BlockingWifi, EspWifi};
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition};
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported

use log::{error, info};

const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

// Setup Wifi
Expand Down
4 changes: 2 additions & 2 deletions examples/json_post_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ use embedded_svc::{
wifi::{self, AccessPointConfiguration, AuthMethod},
};
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::sys::{self as _};
use esp_idf_svc::{
eventloop::EspSystemEventLoop,
http::server::EspHttpServer,
nvs::EspDefaultNvsPartition,
wifi::{BlockingWifi, EspWifi},
};
use esp_idf_sys::{self as _};
use log::*;
use serde::Deserialize;
use serde_json;
Expand All @@ -41,7 +41,7 @@ struct FormData<'a> {
}

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
esp_idf_svc::log::EspLogger::initialize_default();
let mut server = create_server()?;

Expand Down
4 changes: 2 additions & 2 deletions examples/nvs_get_set_c_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
//! More info reagarding NVS:
//! https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/nvs_flash.html

use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_svc::sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported

use esp_idf_svc::log::EspLogger;
use esp_idf_svc::nvs::*;
use log::info;

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

let nvs_default_partition: EspNvsPartition<NvsDefault> =
Expand Down
4 changes: 2 additions & 2 deletions examples/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ use embedded_svc::io::Write;
use embedded_svc::wifi::{AuthMethod, ClientConfiguration, Configuration};
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::log::EspLogger;
use esp_idf_svc::sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_svc::tls::{self, EspTls, X509};
use esp_idf_svc::wifi::{BlockingWifi, EspWifi};
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition};
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use log::info;

const SSID: &str = env!("WIFI_SSID");
Expand Down Expand Up @@ -50,7 +50,7 @@ A7sKPPcw7+uvTPyLNhBzPvOk
-----END CERTIFICATE-----\0";

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

let peripherals = Peripherals::take().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
use embedded_svc::wifi::{AuthMethod, ClientConfiguration, Configuration};
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::log::EspLogger;
use esp_idf_svc::sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_svc::wifi::{BlockingWifi, EspWifi};
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition};
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use log::info;

const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

let peripherals = Peripherals::take().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/wifi_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
use embedded_svc::wifi::{AuthMethod, ClientConfiguration, Configuration};
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::log::EspLogger;
use esp_idf_svc::sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use esp_idf_svc::timer::EspTaskTimerService;
use esp_idf_svc::wifi::{AsyncWifi, EspWifi};
use esp_idf_svc::{eventloop::EspSystemEventLoop, nvs::EspDefaultNvsPartition};
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
use futures::executor::block_on;
use log::info;

const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
EspLogger::initialize_default();

let peripherals = Peripherals::take().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions examples/ws_guessing_game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ use embedded_svc::{
ws::FrameType,
};
use esp_idf_hal::prelude::Peripherals;
use esp_idf_svc::sys::{self as _, EspError, ESP_ERR_INVALID_SIZE};
use esp_idf_svc::{
eventloop::EspSystemEventLoop,
http::server::EspHttpServer,
nvs::EspDefaultNvsPartition,
systime::EspSystemTime,
wifi::{BlockingWifi, EspWifi},
};
use esp_idf_sys::{self as _, EspError, ESP_ERR_INVALID_SIZE};
use log::*;

use std::{borrow::Cow, collections::BTreeMap, str, sync::Mutex};
Expand Down Expand Up @@ -115,7 +115,7 @@ fn nth(n: u32) -> Cow<'static, str> {
}

fn main() -> anyhow::Result<()> {
esp_idf_sys::link_patches();
esp_idf_svc::sys::link_patches();
esp_idf_svc::log::EspLogger::initialize_default();
let mut server = create_server()?;

Expand Down

0 comments on commit 9ba46fa

Please sign in to comment.