Skip to content

Switch back to MonoTimer from HAL #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 3 additions & 5 deletions src/11-usart/auxiliary/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ pub use cortex_m::{asm::bkpt, iprint, iprintln, peripheral::ITM};
pub use cortex_m_rt::entry;
pub use stm32f3_discovery::stm32f3xx_hal::pac::usart1;

pub mod monotimer;

use stm32f3_discovery::stm32f3xx_hal::{
prelude::*,
serial::Serial,
pac::{self, USART1},
timer::MonoTimer,
};
use monotimer::MonoTimer;

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

let mut flash = dp.FLASH.constrain();
Expand Down Expand Up @@ -56,7 +54,7 @@ pub fn init() -> (&'static mut usart1::RegisterBlock, MonoTimer, ITM) {
unsafe {
(
&mut *(USART1::ptr() as *mut _),
MonoTimer::new(cp.DWT, clocks),
MonoTimer::new(cp.DWT, clocks, &mut cp.DCB),
cp.ITM,
)
}
Expand Down
54 changes: 0 additions & 54 deletions src/11-usart/auxiliary/src/monotimer.rs

This file was deleted.