Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rebase and update etm driver to fix build errors
  • Loading branch information
jessebraham committed Sep 26, 2023
commit 6c287843f0ecb36fdcd31d74a2be068896802d54
10 changes: 4 additions & 6 deletions esp-hal-common/src/etm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//! let led_task = gpio_ext.channel0_task.toggle(&mut led);
//! let button_event = gpio_ext.channel0_event.falling_edge(button);
//!
//! let etm = Etm::new(peripherals.SOC_ETM, &mut system.peripheral_clock_control);
//! let etm = Etm::new(peripherals.SOC_ETM);
//! let channel0 = etm.channel0;
//!
//! // make sure the configured channel doesn't get dropped - dropping it will
Expand Down Expand Up @@ -241,12 +241,10 @@ macro_rules! create_etm_constructor {
($($num:literal),+) => {
paste::paste! {
impl<'d> Etm<'d> {
pub fn new(
peripheral: impl Peripheral<P = crate::peripherals::SOC_ETM> + 'd,
peripheral_clock_control: &mut PeripheralClockControl,
) -> Self {
pub fn new(peripheral: impl Peripheral<P = crate::peripherals::SOC_ETM> + 'd) -> Self {
crate::into_ref!(peripheral);
peripheral_clock_control.enable(crate::system::Peripheral::Etm);

PeripheralClockControl::enable(crate::system::Peripheral::Etm);

Self {
_peripheral: peripheral,
Expand Down
4 changes: 2 additions & 2 deletions esp32c6-hal/examples/etm_gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use esp_backtrace as _;
fn main() -> ! {
esp_println::logger::init_logger_from_env();
let peripherals = Peripherals::take();
let mut system = peripherals.PCR.split();
let system = peripherals.PCR.split();
let _clocks = ClockControl::boot_defaults(system.clock_control).freeze();

let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
Expand All @@ -30,7 +30,7 @@ fn main() -> ! {
let led_task = gpio_ext.channel0_task.toggle(&mut led);
let button_event = gpio_ext.channel0_event.falling_edge(button);

let etm = Etm::new(peripherals.SOC_ETM, &mut system.peripheral_clock_control);
let etm = Etm::new(peripherals.SOC_ETM);
let channel0 = etm.channel0;

// make sure the configured channel doesn't get dropped - dropping it will
Expand Down
4 changes: 2 additions & 2 deletions esp32h2-hal/examples/etm_gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use esp_backtrace as _;
fn main() -> ! {
esp_println::logger::init_logger_from_env();
let peripherals = Peripherals::take();
let mut system = peripherals.PCR.split();
let system = peripherals.PCR.split();
let _clocks = ClockControl::boot_defaults(system.clock_control).freeze();

let io = IO::new(peripherals.GPIO, peripherals.IO_MUX);
Expand All @@ -30,7 +30,7 @@ fn main() -> ! {
let led_task = gpio_ext.channel0_task.toggle(&mut led);
let button_event = gpio_ext.channel0_event.falling_edge(button);

let etm = Etm::new(peripherals.SOC_ETM, &mut system.peripheral_clock_control);
let etm = Etm::new(peripherals.SOC_ETM);
let channel0 = etm.channel0;

// make sure the configured channel doesn't get dropped - dropping it will
Expand Down