Skip to content

Commit dc1c8a5

Browse files
committed
Switch back to MonoTimer from HAL
This switches back from the local replacement for MonoTimer from 814c051 to the one re-added with HAL release 0.8.0. MonoTimers interface changed in the meantime so this commit takes this into account as well.
1 parent ac081ca commit dc1c8a5

File tree

2 files changed

+3
-59
lines changed

2 files changed

+3
-59
lines changed

src/11-usart/auxiliary/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ pub use cortex_m::{asm::bkpt, iprint, iprintln, peripheral::ITM};
99
pub use cortex_m_rt::entry;
1010
pub use stm32f3_discovery::stm32f3xx_hal::pac::usart1;
1111

12-
pub mod monotimer;
13-
1412
use stm32f3_discovery::stm32f3xx_hal::{
1513
prelude::*,
1614
serial::Serial,
1715
pac::{self, USART1},
16+
timer::MonoTimer,
1817
};
19-
use monotimer::MonoTimer;
2018

2119
pub fn init() -> (&'static mut usart1::RegisterBlock, MonoTimer, ITM) {
22-
let cp = cortex_m::Peripherals::take().unwrap();
20+
let mut cp = cortex_m::Peripherals::take().unwrap();
2321
let dp = pac::Peripherals::take().unwrap();
2422

2523
let mut flash = dp.FLASH.constrain();
@@ -56,7 +54,7 @@ pub fn init() -> (&'static mut usart1::RegisterBlock, MonoTimer, ITM) {
5654
unsafe {
5755
(
5856
&mut *(USART1::ptr() as *mut _),
59-
MonoTimer::new(cp.DWT, clocks),
57+
MonoTimer::new(cp.DWT, clocks, &mut cp.DCB),
6058
cp.ITM,
6159
)
6260
}

src/11-usart/auxiliary/src/monotimer.rs

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)