From 81275bfa4f41e2066770087f3a33cad4227eab41 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 13 Jun 2019 23:56:59 +0200 Subject: rtfm-syntax refactor + heterogeneous multi-core support --- examples/static.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index 2e3b5b4..eeb522f 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -5,14 +5,15 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; +use panic_semihosting as _; #[rtfm::app(device = lm3s6965)] const APP: () = { - static KEY: u32 = (); + extern "C" { + static KEY: u32; + } #[init] fn init(_: init::Context) -> init::LateResources { -- cgit v1.2.3 From 4e51bb68b976c6bb6a9a989dc560d2a8123a84ca Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Thu, 20 Jun 2019 06:19:59 +0200 Subject: RFC #207 --- examples/static.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index eeb522f..5eb7b19 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -23,15 +23,15 @@ const APP: () = { init::LateResources { KEY: 0xdeadbeef } } - #[interrupt(resources = [KEY])] - fn UART0(c: UART0::Context) { + #[task(binds = UART0, resources = [KEY])] + fn uart0(c: uart0::Context) { hprintln!("UART0(KEY = {:#x})", c.resources.KEY).unwrap(); debug::exit(debug::EXIT_SUCCESS); } - #[interrupt(priority = 2, resources = [KEY])] - fn UART1(c: UART1::Context) { + #[task(binds = UART1, priority = 2, resources = [KEY])] + fn uart1(c: uart1::Context) { hprintln!("UART1(KEY = {:#x})", c.resources.KEY).unwrap(); } }; -- cgit v1.2.3 From 9195038c87703fc94b6e99f6de593886d51c2b19 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 10 Jul 2019 22:42:44 +0200 Subject: implement RFC #212 --- examples/static.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs index 5eb7b19..4af7ee6 100644 --- a/examples/static.rs +++ b/examples/static.rs @@ -11,8 +11,8 @@ use panic_semihosting as _; #[rtfm::app(device = lm3s6965)] const APP: () = { - extern "C" { - static KEY: u32; + struct Resources { + key: u32, } #[init] @@ -20,18 +20,18 @@ const APP: () = { rtfm::pend(Interrupt::UART0); rtfm::pend(Interrupt::UART1); - init::LateResources { KEY: 0xdeadbeef } + init::LateResources { key: 0xdeadbeef } } - #[task(binds = UART0, resources = [KEY])] + #[task(binds = UART0, resources = [&key])] fn uart0(c: uart0::Context) { - hprintln!("UART0(KEY = {:#x})", c.resources.KEY).unwrap(); + hprintln!("UART0(key = {:#x})", c.resources.key).unwrap(); debug::exit(debug::EXIT_SUCCESS); } - #[task(binds = UART1, priority = 2, resources = [KEY])] + #[task(binds = UART1, priority = 2, resources = [&key])] fn uart1(c: uart1::Context) { - hprintln!("UART1(KEY = {:#x})", c.resources.KEY).unwrap(); + hprintln!("UART1(key = {:#x})", c.resources.key).unwrap(); } }; -- cgit v1.2.3 From 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 21 Aug 2019 10:17:27 +0200 Subject: doc up --- examples/static.rs | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 examples/static.rs (limited to 'examples/static.rs') diff --git a/examples/static.rs b/examples/static.rs deleted file mode 100644 index 4af7ee6..0000000 --- a/examples/static.rs +++ /dev/null @@ -1,37 +0,0 @@ -//! examples/static.rs - -#![deny(unsafe_code)] -#![deny(warnings)] -#![no_main] -#![no_std] - -use cortex_m_semihosting::{debug, hprintln}; -use lm3s6965::Interrupt; -use panic_semihosting as _; - -#[rtfm::app(device = lm3s6965)] -const APP: () = { - struct Resources { - key: u32, - } - - #[init] - fn init(_: init::Context) -> init::LateResources { - rtfm::pend(Interrupt::UART0); - rtfm::pend(Interrupt::UART1); - - init::LateResources { key: 0xdeadbeef } - } - - #[task(binds = UART0, resources = [&key])] - fn uart0(c: uart0::Context) { - hprintln!("UART0(key = {:#x})", c.resources.key).unwrap(); - - debug::exit(debug::EXIT_SUCCESS); - } - - #[task(binds = UART1, priority = 2, resources = [&key])] - fn uart1(c: uart1::Context) { - hprintln!("UART1(key = {:#x})", c.resources.key).unwrap(); - } -}; -- cgit v1.2.3