Skip to content
Snippets Groups Projects
Commit ecba8432 authored by Blinningjr's avatar Blinningjr
Browse files

rtt_timing F

parent 1941bf50
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 {}",
...@@ -348,9 +351,10 @@ fn timed_loop() -> (u32, u32) { ...@@ -348,9 +351,10 @@ fn timed_loop() -> (u32, u32) {
// (when hitting the `timed_loop` breakpoint)? // (when hitting the `timed_loop` breakpoint)?
// //
// [Your answer here] // [Your answer here]
// 0x00000009
// //
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// F) Finally some statics // G) Finally some statics
// For embedded it is often/typically crucial to reduce overhead, // For embedded it is often/typically crucial to reduce overhead,
// - code footprint (flash memory) // - code footprint (flash memory)
// - memory footprint (sram memory) // - memory footprint (sram memory)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment