Skip to content

Commit

Permalink
Make eth example esp32 only
Browse files Browse the repository at this point in the history
  • Loading branch information
torkleyy committed Aug 30, 2023
1 parent 44f5acc commit 917aaef
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 1 deletion.
12 changes: 11 additions & 1 deletion examples/eth.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
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},
eventloop::EspSystemEventLoop,
hal::{gpio, prelude::Peripherals},
log::EspLogger,
};
use esp_idf_sys::{self as _}; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported
#[cfg(esp32)]
use log::info;

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

let peripherals = Peripherals::take().unwrap();
Expand Down Expand Up @@ -53,3 +58,8 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

#[cfg(not(esp32))]
fn main() {
panic!("This example is configured for esp32, please adjust pins to your module");
}
1 change: 1 addition & 0 deletions examples/http_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

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

// Setup Wifi
Expand Down
1 change: 1 addition & 0 deletions examples/nvs_get_set_c_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use esp_idf_svc::nvs::*;
use log::info;

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

let nvs_default_partition: EspNvsPartition<NvsDefault> =
Expand Down
1 change: 1 addition & 0 deletions examples/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ A7sKPPcw7+uvTPyLNhBzPvOk
-----END CERTIFICATE-----\0";

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

let peripherals = Peripherals::take().unwrap();
Expand Down
1 change: 1 addition & 0 deletions examples/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

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

let peripherals = Peripherals::take().unwrap();
Expand Down
1 change: 1 addition & 0 deletions examples/wifi_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const SSID: &str = env!("WIFI_SSID");
const PASSWORD: &str = env!("WIFI_PASS");

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

let peripherals = Peripherals::take().unwrap();
Expand Down

0 comments on commit 917aaef

Please sign in to comment.