Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2021
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Österberg
e7020e_2021
Commits
33bb1704
Commit
33bb1704
authored
4 years ago
by
Carl Österberg
Browse files
Options
Downloads
Patches
Plain Diff
Feedback fixes
parent
50bc2181
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/rtic_bare1.rs
+7
-5
7 additions, 5 deletions
examples/rtic_bare1.rs
examples/rtic_bare3.rs
+6
-6
6 additions, 6 deletions
examples/rtic_bare3.rs
with
13 additions
and
11 deletions
examples/rtic_bare1.rs
+
7
−
5
View file @
33bb1704
...
...
@@ -22,9 +22,8 @@ const APP: () = {
loop
{
//cortex_m::asm::bkpt();
//x = x.wrapping_add(1);
//cortex_m::asm::bkpt();
x
+=
1
;
//cortex_m::asm::bkpt();
// prevent optimization by read-volatile (unsafe)
// unsafe {
// core::ptr::read_volatile(&x);
...
...
@@ -67,9 +66,12 @@ const APP: () = {
// > backtrace
//
// Paste the backtrace:
// #0 rtic_bare1::init (_cx=...) at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:29
// #1 0x08000f08 in rtic_bare1::APP::main () at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:15
// {"token":59,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
// #0 rust_begin_unwind (info=0x2000fee0) at /home/carlosterberg/.cargo/registry/src/github.com-1ecc6299db9ec823/panic-semihosting-0.5.6/src/lib.rs:95
// #1 0x0800039a in core::panicking::panic_fmt () at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b//library/core/src/panicking.rs:92
// #2 0x08000374 in core::panicking::panic () at /rustc/cb75ad5db02783e8b0222fee363c5f63f7e2cf5b//library/core/src/panicking.rs:50
// #3 0x08000eac in rtic_bare1::init (_cx=...) at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:25
// #4 0x08000ef6 in rtic_bare1::APP::main () at /home/carlosterberg/Skrivbord/e7020e_2021/examples/rtic_bare1.rs:15
// {"token":58,"outOfBandRecord":[],"resultRecords":{"resultClass":"done","results":[]}}
//
//
// Explain in your own words the chain of calls.
...
...
This diff is collapsed.
Click to expand it.
examples/rtic_bare3.rs
+
6
−
6
View file @
33bb1704
...
...
@@ -23,14 +23,15 @@ const APP: () = {
let
start
=
Instant
::
now
();
wait
(
1_000_000
);
let
end
=
Instant
::
now
();
//let end = Instant::now();
let
end
=
start
.elapsed
();
// notice all printing outside of the section to measure!
hprintln!
(
"Start {:?}"
,
start
)
.ok
();
hprintln!
(
"End {:?}"
,
end
)
.ok
();
//
hprintln!("End {:?}", end).ok();
//hprintln!("Diff {:?}", (end - start).as_cycles()).ok();
//hprintln!("Diff {:?}", end.duration_since(start).as_cycles()).ok();
hprintln!
(
"Diff {:?}"
,
(
start
.elapsed
()
-
end
.elapsed
())
.as_cycles
())
.ok
();
hprintln!
(
"Diff {:?}"
,
end
.as_cycles
())
.ok
();
}
};
...
...
@@ -102,9 +103,8 @@ fn wait(i: u32) {
//
// What is now the output in the Adapter Output console?
//
// Start Instant(1175751045)
// End Instant(1179751061)
// Diff 4000009
// Start Instant(1072806007)
// Diff 4000016
//
// Commit your answers (bare3_3)
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment