From 85fe7a2836f407a7a75863b75179911b18c70ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 15:50:23 +0100 Subject: [PATCH 1/6] Add missing init --- template/src/bin/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/template/src/bin/main.rs b/template/src/bin/main.rs index ed61a72..0726156 100644 --- a/template/src/bin/main.rs +++ b/template/src/bin/main.rs @@ -24,6 +24,12 @@ extern crate alloc; #[entry] fn main() -> ! { + let peripherals = esp_hal::init({ + let mut config = esp_hal::Config::default(); + config.cpu_clock = CpuClock::max(); + config + }); + //IF !option("probe-rs") esp_println::logger::init_logger_from_env(); //ENDIF From 5486980d9d2521f9e76a946158e675769a180f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 15:56:54 +0100 Subject: [PATCH 2/6] Remove double init --- template/src/bin/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/template/src/bin/main.rs b/template/src/bin/main.rs index 0726156..b682792 100644 --- a/template/src/bin/main.rs +++ b/template/src/bin/main.rs @@ -39,8 +39,6 @@ fn main() -> ! { //ENDIF //IF option("wifi") || option("ble") - let peripherals = esp_hal::init(esp_hal::Config::default()); - let timg0 = TimerGroup::new(peripherals.TIMG0); let _init = esp_wifi::init( timg0.timer0, From db4eff28cf306015038695da2cfd186e6e20bdbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 15:58:47 +0100 Subject: [PATCH 3/6] Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90e0445..c3f13d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Added missing init code in non-async template + ### Removed ## [0.2.0] - 2024-11-21 From 39417f819aeb2a623a70cc5c8c0ed8b0e342140f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 16:10:22 +0100 Subject: [PATCH 4/6] Don't generate warning --- template/src/bin/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/template/src/bin/main.rs b/template/src/bin/main.rs index b682792..9aa7184 100644 --- a/template/src/bin/main.rs +++ b/template/src/bin/main.rs @@ -24,7 +24,11 @@ extern crate alloc; #[entry] fn main() -> ! { + //IF option("wifi") || option("ble") let peripherals = esp_hal::init({ + //ELSE + //+let _peripherals = esp_hal::init({ + //ENDIF let mut config = esp_hal::Config::default(); config.cpu_clock = CpuClock::max(); config From f7d66466bfd3760c1f4e3bf1c60a884d276bad17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 16:25:29 +0100 Subject: [PATCH 5/6] Merge imports --- template/src/bin/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/template/src/bin/main.rs b/template/src/bin/main.rs index 9aa7184..9b96b6a 100644 --- a/template/src/bin/main.rs +++ b/template/src/bin/main.rs @@ -4,12 +4,9 @@ use esp_backtrace as _; use esp_hal::{delay::Delay, prelude::*}; -//IF option("wifi") +//IF option("wifi") || option("ble") use esp_hal::timer::timg::TimerGroup; //ENDIF -//IF option("ble") -//+ use esp_hal::timer::timg::TimerGroup; -//ENDIF //IF option("probe-rs") //+ use defmt_rtt as _; From 516f6517eed452a36cc8bfd6d072deb0e0fabf86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Fri, 22 Nov 2024 16:25:55 +0100 Subject: [PATCH 6/6] Ignore outermost vscode folder --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ab154f0..72bcf20 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ **/target src/template_files.rs template/Cargo.lock +/.vscode