Skip to content

Commit

Permalink
Remember that ESP32 doesn't have SYSTIMER and switch to TIMG0 instead
Browse files Browse the repository at this point in the history
  • Loading branch information
jessebraham committed Jul 10, 2024
1 parent 8e44b1e commit dbb2d02
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions embassy/src/bin/firmware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use esp_hal::{
prelude::*,
rtc_cntl::Rtc,
system::SystemControl,
timer::{systimer::SystemTimer, OneShotTimer},
timer::{timg::TimerGroup, OneShotTimer},
};
use static_cell::make_static;

Expand All @@ -30,8 +30,8 @@ async fn main(spawner: Spawner) {
info!("RWDT watchdog enabled!");

// Initialize the SYSTIMER peripheral, and then Embassy:
let systimer = SystemTimer::new(peripherals.SYSTIMER);
let timers = [OneShotTimer::new(systimer.alarm0.into())];
let timg0 = TimerGroup::new(peripherals.TIMG0, &clocks, None);
let timers = [OneShotTimer::new(timg0.timer0.into())];
let timers = make_static!(timers);
esp_hal_embassy::init(&clocks, timers);
info!("Embassy initialized!");
Expand Down

0 comments on commit dbb2d02

Please sign in to comment.