Skip to content

Commit

Permalink
Add third set of profiling macros
Browse files Browse the repository at this point in the history
This allows using three probes at once.

Signed-off-by: Petr Horacek <[email protected]>
  • Loading branch information
phoracek committed Sep 10, 2021
1 parent da2ccca commit 6e65d50
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions eurorack/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,20 @@ macro_rules! profile {
gpioc.moder.modify(|_, w| w.moder11().output());
gpioc.odr.modify(|_, w| w.odr11().clear_bit());
}};
(c, on) => {{
use daisy_bsp::hal::pac::{GPIOC, RCC};
let rcc = unsafe { &*RCC::ptr() };
let gpioc = unsafe { &*GPIOC::ptr() };
rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
gpioc.moder.modify(|_, w| w.moder10().output());
gpioc.odr.modify(|_, w| w.odr10().set_bit());
}};
(c, off) => {{
use daisy_bsp::hal::pac::{GPIOC, RCC};
let rcc = unsafe { &*RCC::ptr() };
let gpioc = unsafe { &*GPIOC::ptr() };
rcc.ahb4enr.modify(|_, w| w.gpiocen().set_bit());
gpioc.moder.modify(|_, w| w.moder10().output());
gpioc.odr.modify(|_, w| w.odr10().clear_bit());
}};
}

0 comments on commit 6e65d50

Please sign in to comment.