Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rtfm-app
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
Samuel Karlsson
rtfm-app
Commits
6a2fde39
Commit
6a2fde39
authored
7 years ago
by
Per
Browse files
Options
Downloads
Patches
Plain Diff
loop, example
parent
11b07850
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.vscode/launch.json
+18
-0
18 additions, 0 deletions
.vscode/launch.json
.vscode/tasks.json
+14
-8
14 additions, 8 deletions
.vscode/tasks.json
examples/loop.rs
+36
-0
36 additions, 0 deletions
examples/loop.rs
with
68 additions
and
8 deletions
.vscode/launch.json
+
18
−
0
View file @
6a2fde39
...
@@ -40,5 +40,23 @@
...
@@ -40,5 +40,23 @@
],
],
"cwd"
:
"${workspaceRoot}"
"cwd"
:
"${workspaceRoot}"
},
},
{
"type"
:
"gdb"
,
"request"
:
"attach"
,
"name"
:
"loop"
,
"gdbpath"
:
"/usr/bin/arm-none-eabi-gdb"
,
"executable"
:
"./target/thumbv7em-none-eabihf/debug/examples/loop"
,
"target"
:
":3333"
,
"remote"
:
true
,
"autorun"
:
[
"monitor reset init"
,
"monitor arm semihosting enable"
,
"monitor tpiu config internal /tmp/itm.log uart off 64000000"
,
"monitor itm port 0 on"
,
"load"
,
"monitor reset init"
],
"cwd"
:
"${workspaceRoot}"
},
]
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
.vscode/tasks.json
+
14
−
8
View file @
6a2fde39
...
@@ -6,10 +6,7 @@
...
@@ -6,10 +6,7 @@
{
{
"type"
:
"shell"
,
"type"
:
"shell"
,
"label"
:
"xargo build"
,
"label"
:
"xargo build"
,
"command"
:
"xargo"
,
"command"
:
"xargo build"
,
"args"
:
[
"build"
],
"problemMatcher"
:
[
"problemMatcher"
:
[
"$rustc"
"$rustc"
],
],
...
@@ -21,10 +18,7 @@
...
@@ -21,10 +18,7 @@
{
{
"type"
:
"shell"
,
"type"
:
"shell"
,
"label"
:
"xargo build --release"
,
"label"
:
"xargo build --release"
,
"command"
:
"xargo"
,
"command"
:
"xargo build --release"
,
"args"
:
[
"build --release"
],
"problemMatcher"
:
[
"problemMatcher"
:
[
"$rustc"
"$rustc"
],
],
...
@@ -32,6 +26,18 @@
...
@@ -32,6 +26,18 @@
"kind"
:
"build"
,
"kind"
:
"build"
,
"isDefault"
:
true
"isDefault"
:
true
}
}
},
{
"type"
:
"shell"
,
"label"
:
"xargo build --example loop"
,
"command"
:
"xargo build --example loop "
,
"problemMatcher"
:
[
"$rustc"
],
"group"
:
{
"kind"
:
"build"
,
"isDefault"
:
true
}
}
},
]
]
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
examples/loop.rs
0 → 100644
+
36
−
0
View file @
6a2fde39
//! Nesting claims and how the preemption threshold works
//!
//! If you run this program you'll hit the breakpoints as indicated by the
//! letters in the comments: A, then B, then C, etc.
#![deny(unsafe_code)]
#![feature(proc_macro)]
#![no_std]
extern
crate
cortex_m
;
extern
crate
cortex_m_rtfm
as
rtfm
;
extern
crate
stm32f40x
;
#[macro_use]
extern
crate
cortex_m_debug
;
use
rtfm
::
app
;
app!
{
device
:
stm32f40x
,
}
fn
init
(
_p
:
init
::
Peripherals
)
{
let
mut
sum
=
0
;
for
i
in
0
..
10
{
ipln!
(
"i = {}"
,
i
);
sum
+=
i
;
}
ipln!
(
"Sum 0 .. 10 = {}"
,
sum
);
}
#[inline(never)]
fn
idle
()
->
!
{
loop
{
rtfm
::
wfi
();
}
}
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