Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
e7020e_2019
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
Model registry
Operate
Environments
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
August Svensson
e7020e_2019
Commits
03000f57
Commit
03000f57
authored
6 years ago
by
August Svensson
Browse files
Options
Downloads
Patches
Plain Diff
bare4_3
parent
9dcb4b87
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare4.rs
+10
-4
10 additions, 4 deletions
examples/bare4.rs
with
10 additions
and
4 deletions
examples/bare4.rs
+
10
−
4
View file @
03000f57
...
...
@@ -121,17 +121,23 @@ fn main() -> ! {
//
// Why is it important that ordering of volatile operations are ensured by the compiler?
//
// ** If read/write instructions are reordered, the consequences are undefined, since peripherals
// depend on the contents of registers that are read from/written to. **
// ** If read/write instructions are reordered, the consequences are undefined, since
// what was intended to be read might not be there. And since peripherals' configurations
// depend on the contents of registers that are read from/written to, configurations might
// go wrong. **
//
// Give an example in the above code, where reordering might make things go horribly wrong
// (hint, accessing a peripheral not being powered...)
//
// ** your answer here **
// ** We set port A to general purpose output mode. There is undefined, unintended behaviour
// if we write to the port bits without enabling it. **
//
// Without the non-reording proprety of `write_volatile/read_volatile` could that happen in theory
// (argue from the point of data dependencies).
//
// ** your answer here **
// ** If we read from a register to apply a mask on it, it most probably needs to remain that value
// before writing the masked value to it, otherwise the masked value is not accurate. If read/writes
// are reordered during many reads and writes (e.g. during configuration), the configuration might end
// up faulty. **
//
// Commit your answers (bare4_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