diff --git a/Cargo.toml b/Cargo.toml index 54b8fbe..2db4aa5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,9 @@ experimental = ["esp-idf-svc/experimental"] embassy = ["esp-idf-svc/embassy-sync", "esp-idf-svc/critical-section", "esp-idf-svc/embassy-time-driver"] [dependencies] +anyhow = "1.0.79" log = { version = "0.4", default-features = false } +esp-idf-sys = { version = "0.34", features = ["binstart"] } esp-idf-svc = { version = "0.48", default-features = false } [build-dependencies] diff --git a/src/main.rs b/src/main.rs index 9f40bc6..205acea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,14 @@ -fn main() { - // It is necessary to call this function once. Otherwise some patches to the runtime - // implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71 +use anyhow::Ok; +use esp_idf_sys::esp_app_desc; + +esp_app_desc!(); + +fn main() -> anyhow::Result<()> { esp_idf_svc::sys::link_patches(); - // Bind the log crate to the ESP Logging facilities esp_idf_svc::log::EspLogger::initialize_default(); log::info!("Hello, world!"); + + Ok(()) }