Skip to content
Snippets Groups Projects
Commit 079a9e69 authored by Edvin Åkerfeldt's avatar Edvin Åkerfeldt
Browse files

rtt_timing, F part 1 complete

parent 472026b2
No related branches found
No related tags found
No related merge requests found
//! examples/rtt_timing.rs //! examples/rtt_timing.rs
#![deny(unsafe_code)] //#![deny(unsafe_code)]
#![deny(warnings)] #![deny(warnings)]
#![no_main] #![no_main]
#![no_std] #![no_std]
...@@ -22,6 +22,9 @@ const APP: () = { ...@@ -22,6 +22,9 @@ const APP: () = {
cx.core.DWT.enable_cycle_counter(); cx.core.DWT.enable_cycle_counter();
rprintln!("start timed_loop"); rprintln!("start timed_loop");
unsafe {
cx.core.DWT.cyccnt.write(0);
}
let (start, end) = timed_loop(); let (start, end) = timed_loop();
rprintln!( rprintln!(
"start {}, end {}, diff {}", "start {}, end {}, diff {}",
...@@ -377,6 +380,9 @@ It increases by 4. ...@@ -377,6 +380,9 @@ It increases by 4.
// (when hitting the `timed_loop` breakpoint)? // (when hitting the `timed_loop` breakpoint)?
// //
// [Your answer here] // [Your answer here]
/*
Cycle counter is at 6 cycles.
*/
// //
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// F) Finally some statics // F) Finally some statics
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment