From 6e65d500ed29b89aec34cfa5c43501bc72f1fc69 Mon Sep 17 00:00:00 2001 From: Petr Horacek Date: Fri, 10 Sep 2021 18:08:07 +0200 Subject: [PATCH] Add third set of profiling macros This allows using three probes at once. Signed-off-by: Petr Horacek --- eurorack/src/profiling.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/eurorack/src/profiling.rs b/eurorack/src/profiling.rs index eb0ca7d..0d65535 100644 --- a/eurorack/src/profiling.rs +++ b/eurorack/src/profiling.rs @@ -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()); + }}; }