Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
labs
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emil Kitti
labs
Commits
78976718
Commit
78976718
authored
Jan 26, 2018
by
Emil Kitti
Browse files
Options
Downloads
Patches
Plain Diff
bare0_2
parent
3e239743
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/bare0.rs
+13
-2
13 additions, 2 deletions
examples/bare0.rs
with
13 additions
and
2 deletions
examples/bare0.rs
+
13
−
2
View file @
78976718
...
@@ -6,10 +6,12 @@
...
@@ -6,10 +6,12 @@
// build without the Rust standard library
// build without the Rust standard library
#![no_std]
#![no_std]
use
core
::
u32
;
// Minimal runtime / startup for Cortex-M microcontrollers
// Minimal runtime / startup for Cortex-M microcontrollers
extern
crate
cortex_m_rt
;
extern
crate
cortex_m_rt
;
const
X_INIT
:
u32
=
10
;
const
X_INIT
:
u32
=
u32
::
MAX
;
static
mut
X
:
u32
=
X_INIT
;
static
mut
X
:
u32
=
X_INIT
;
static
mut
Y
:
u32
=
0
;
static
mut
Y
:
u32
=
0
;
...
@@ -52,7 +54,16 @@ fn main() {
...
@@ -52,7 +54,16 @@ fn main() {
//
//
// 2. alter the constant X_INIT so that line 22 directly causes the x to wrap
// 2. alter the constant X_INIT so that line 22 directly causes the x to wrap
// what happens when x wraps
// what happens when x wraps
// ** your answer here **
//
// (gdb) print x
// $1 = 4294967295
// (gdb) next
//
// Program received signal SIGTRAP, Trace/breakpoint trap.
// cortex_m_rt::default_handler (ef=0x20017e68) at /home/kitzin/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-rt-0.3.12/src/lib.rs:454
// 454 asm::bkpt();
//
// An interrupt is triggered!
//
//
// commit your answers (bare0_2)
// commit your answers (bare0_2)
//
//
...
...
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