diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cirque.rs | 4 | ||||
-rwxr-xr-x | src/main.rs | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/cirque.rs b/src/cirque.rs index b19b1f4..23df15b 100644 --- a/src/cirque.rs +++ b/src/cirque.rs @@ -2,7 +2,6 @@ use core::cmp::{max, min}; use embedded_hal::{digital::v2::OutputPin, spi}; use nb; -use stm32f1xx_hal::rcc::Clocks; /// Default I²C address. #[allow(unused)] @@ -141,11 +140,10 @@ impl<C> Cirque<C> where C: OutputPin, { - pub fn new<S>(cs_pin: C, spi: &mut S, clocks: Clocks) -> nb::Result<Self, S::Error> + pub fn new<S>(cs_pin: C, spi: &mut S, sysclk_speed: u32) -> nb::Result<Self, S::Error> where S: spi::FullDuplex<u8>, { - let sysclk_speed = clocks.sysclk().raw(); let mut res = Self { cs_pin, sysclk_speed, diff --git a/src/main.rs b/src/main.rs index 8c2bac1..fdeb257 100755 --- a/src/main.rs +++ b/src/main.rs @@ -89,7 +89,7 @@ fn main() -> ! { 1_000_000.Hz(), // pinnacle supports up to 13mhz clocks, ); - let mut cirque = match Cirque::new(cs_pin, &mut spi, clocks) { + let mut cirque = match Cirque::new(cs_pin, &mut spi, clocks.sysclk().raw()) { Ok(c) => c, Err(e) => { logln!("err: {:?}", e); |