aboutsummaryrefslogtreecommitdiff
path: root/examples/cfg.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2019-04-21 20:10:40 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2019-05-01 20:49:25 +0200
commit1b4b006bab7ee05e403a4fc48ae751d037f95b1a (patch)
tree62d7e7ebf3f8fc6fff10cf92cb1623a025163006 /examples/cfg.rs
parenta452700628e352e6ac01da9e16223a47752ca860 (diff)
downloadrtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.gz
rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.tar.zst
rtic-1b4b006bab7ee05e403a4fc48ae751d037f95b1a.zip
update examples
Diffstat (limited to 'examples/cfg.rs')
-rw-r--r--examples/cfg.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/cfg.rs b/examples/cfg.rs
index 3f4ca904..03f9dbdc 100644
--- a/examples/cfg.rs
+++ b/examples/cfg.rs
@@ -9,25 +9,24 @@ extern crate panic_semihosting;
#[cfg(debug_assertions)]
use cortex_m_semihosting::hprintln;
-use rtfm::app;
-#[app(device = lm3s6965)]
+#[rtfm::app(device = lm3s6965)]
const APP: () = {
#[cfg(debug_assertions)] // <- `true` when using the `dev` profile
static mut COUNT: u32 = 0;
#[init]
- fn init() {
+ fn init(_: init::Context) {
// ..
}
#[task(priority = 3, resources = [COUNT], spawn = [log])]
- fn foo() {
+ fn foo(c: foo::Context) {
#[cfg(debug_assertions)]
{
- *resources.COUNT += 1;
+ *c.resources.COUNT += 1;
- spawn.log(*resources.COUNT).ok();
+ c.spawn.log(*c.resources.COUNT).ok();
}
// this wouldn't compile in `release` mode
@@ -38,7 +37,7 @@ const APP: () = {
#[cfg(debug_assertions)]
#[task]
- fn log(n: u32) {
+ fn log(_: log::Context, n: u32) {
hprintln!(
"foo has been called {} time{}",
n,