Skip to content

Commit

Permalink
ensure that clock init happens after rtc domain is initialized (#2104)
Browse files Browse the repository at this point in the history
  • Loading branch information
MabezDev authored Sep 6, 2024
1 parent 93f1012 commit a3f7340
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,6 @@ pub struct Config {
pub fn init(config: Config) -> Peripherals {
let mut peripherals = Peripherals::take();

Clocks::init(config.cpu_clock);

#[cfg(xtensa)]
crate::interrupt::setup_interrupts();
#[cfg(esp32)]
crate::time::time_init();

// RTC domain must be enabled before we try to disable
let mut rtc = crate::rtc_cntl::Rtc::new(&mut peripherals.LPWR);
#[cfg(not(any(esp32, esp32s2)))]
Expand All @@ -755,5 +748,12 @@ pub fn init(config: Config) -> Peripherals {
crate::timer::timg::Wdt::<self::peripherals::TIMG1, Blocking>::set_wdt_enabled(false);
}

Clocks::init(config.cpu_clock);

#[cfg(xtensa)]
crate::interrupt::setup_interrupts();
#[cfg(esp32)]
crate::time::time_init();

peripherals
}

0 comments on commit a3f7340

Please sign in to comment.