Skip to content

Commit

Permalink
Add missing init (#57)
Browse files Browse the repository at this point in the history
* Add missing init

* Remove double init

* Changelog

* Don't generate warning

* Merge imports

* Ignore outermost vscode folder
  • Loading branch information
bugadani authored Nov 22, 2024
1 parent 0d89ed2 commit 8a3cd1a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/target
src/template_files.rs
template/Cargo.lock
/.vscode
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 11 additions & 6 deletions template/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _;
Expand All @@ -24,6 +21,16 @@ 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
});

//IF !option("probe-rs")
esp_println::logger::init_logger_from_env();
//ENDIF
Expand All @@ -33,8 +40,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,
Expand Down

0 comments on commit 8a3cd1a

Please sign in to comment.