diff options
| author | Per Lindgren <per.lindgren@ltu.se> | 2020-10-23 10:35:56 +0200 |
|---|---|---|
| committer | Per Lindgren <per.lindgren@ltu.se> | 2020-10-23 23:58:09 +0200 |
| commit | 1c244a995d54332649c1643aa0a3178f169406e4 (patch) | |
| tree | ef7676e7439ccf9407fcde998a654d9700f20524 /examples | |
| parent | 86699039e99229049ee3c739eaf860acc70a1bf7 (diff) | |
move dispatchers to app argument
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/baseline.rs | 9 | ||||
| -rw-r--r-- | examples/capacity.rs | 9 | ||||
| -rw-r--r-- | examples/cfg-whole-task.rs | 10 | ||||
| -rw-r--r-- | examples/cfg.rs | 10 | ||||
| -rw-r--r-- | examples/double_schedule.rs | 6 | ||||
| -rw-r--r-- | examples/message.rs | 9 | ||||
| -rw-r--r-- | examples/not-sync.rs | 9 | ||||
| -rw-r--r-- | examples/periodic.rs | 9 | ||||
| -rw-r--r-- | examples/pool.rs | 10 | ||||
| -rw-r--r-- | examples/ramfunc.rs | 17 | ||||
| -rw-r--r-- | examples/schedule.rs | 9 | ||||
| -rw-r--r-- | examples/spawn.rs | 9 | ||||
| -rw-r--r-- | examples/spawn2.rs | 9 | ||||
| -rw-r--r-- | examples/t-cfg.rs | 10 | ||||
| -rw-r--r-- | examples/t-schedule-core-stable.rs | 9 | ||||
| -rw-r--r-- | examples/t-schedule.rs | 9 | ||||
| -rw-r--r-- | examples/t-spawn.rs | 9 | ||||
| -rw-r--r-- | examples/t-stask-main.rs | 9 | ||||
| -rw-r--r-- | examples/task.rs | 10 | ||||
| -rw-r--r-- | examples/types.rs | 9 |
20 files changed, 27 insertions, 163 deletions
diff --git a/examples/baseline.rs b/examples/baseline.rs index 82f1887..1727874 100644 --- a/examples/baseline.rs +++ b/examples/baseline.rs @@ -8,7 +8,7 @@ use panic_semihosting as _; // NOTE: does NOT properly work on QEMU -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; @@ -47,11 +47,4 @@ mod app { // `foo` inherits the baseline of `UART0`: its `start` time foo::spawn().unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/capacity.rs b/examples/capacity.rs index 29b4f04..b25a758 100644 --- a/examples/capacity.rs +++ b/examples/capacity.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; @@ -40,11 +40,4 @@ mod app { debug::exit(debug::EXIT_SUCCESS); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/cfg-whole-task.rs b/examples/cfg-whole-task.rs index 7a7fc48..0676be2 100644 --- a/examples/cfg-whole-task.rs +++ b/examples/cfg-whole-task.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0])] mod app { use cortex_m_semihosting::debug; #[cfg(debug_assertions)] @@ -83,12 +83,4 @@ mod app { ) .ok(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - fn QEI0(); - } } diff --git a/examples/cfg.rs b/examples/cfg.rs index f900286..50d826d 100644 --- a/examples/cfg.rs +++ b/examples/cfg.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0])] mod app { use cortex_m_semihosting::debug; #[cfg(debug_assertions)] @@ -62,12 +62,4 @@ mod app { ) .ok(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - fn QEI0(); - } } diff --git a/examples/double_schedule.rs b/examples/double_schedule.rs index 78eaac4..32477ef 100644 --- a/examples/double_schedule.rs +++ b/examples/double_schedule.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use rtic::cyccnt::U32Ext; @@ -32,8 +32,4 @@ mod app { fn task2(_cx: task2::Context) { task1::schedule(_cx.scheduled + 100.cycles()).ok(); } - - extern "C" { - fn SSI0(); - } } diff --git a/examples/message.rs b/examples/message.rs index 4306430..4c5d899 100644 --- a/examples/message.rs +++ b/examples/message.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; @@ -45,11 +45,4 @@ mod app { foo::spawn().unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/not-sync.rs b/examples/not-sync.rs index d2616ee..21c316a 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -12,7 +12,7 @@ pub struct NotSync { _0: PhantomData<*const ()>, } -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use super::NotSync; use core::marker::PhantomData; @@ -40,11 +40,4 @@ mod app { fn bar(c: bar::Context) { let _: &NotSync = c.resources.shared; } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/periodic.rs b/examples/periodic.rs index eedf720..3ff9c90 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -8,7 +8,7 @@ use panic_semihosting as _; // NOTE: does NOT work on QEMU! -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::hprintln; use rtic::cyccnt::{Instant, U32Ext}; @@ -31,11 +31,4 @@ mod app { foo::schedule(cx.scheduled + PERIOD.cycles()).unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/pool.rs b/examples/pool.rs index fc740fe..eaad9c0 100644 --- a/examples/pool.rs +++ b/examples/pool.rs @@ -15,7 +15,7 @@ use rtic::app; // Declare a pool of 128-byte memory blocks pool!(P: [u8; 128]); -#[app(device = lm3s6965)] +#[app(device = lm3s6965, dispatchers = [SSI0, QEI0])] mod app { use crate::{Box, Pool}; use cortex_m_semihosting::{debug, hprintln}; @@ -65,12 +65,4 @@ mod app { // this is done automatically so we can omit the call to `drop` // drop(x); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - fn QEI0(); - } } diff --git a/examples/ramfunc.rs b/examples/ramfunc.rs index 4d46c6d..b5aa17b 100644 --- a/examples/ramfunc.rs +++ b/examples/ramfunc.rs @@ -7,7 +7,14 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app( + device = lm3s6965, + dispatchers = [ + UART0, + #[link_section = ".data.UART1"] + UART1 + ]) +] mod app { use cortex_m_semihosting::{debug, hprintln}; @@ -33,12 +40,4 @@ mod app { fn bar(_: bar::Context) { foo::spawn().unwrap(); } - - extern "C" { - fn UART0(); - - // run the task dispatcher from RAM - #[link_section = ".data.UART1"] - fn UART1(); - } } diff --git a/examples/schedule.rs b/examples/schedule.rs index f57f53f..5f73c50 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -8,7 +8,7 @@ use panic_halt as _; // NOTE: does NOT work on QEMU! -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use cortex_m::peripheral::DWT; use cortex_m_semihosting::hprintln; @@ -46,11 +46,4 @@ mod app { fn bar(_: bar::Context) { hprintln!("bar @ {:?}", Instant::now()).unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/spawn.rs b/examples/spawn.rs index 300b3b3..449fcfb 100644 --- a/examples/spawn.rs +++ b/examples/spawn.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; @@ -26,11 +26,4 @@ mod app { } foo::spawn(2, 3).unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/spawn2.rs b/examples/spawn2.rs index 070223b..c485b92 100644 --- a/examples/spawn2.rs +++ b/examples/spawn2.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; @@ -32,11 +32,4 @@ mod app { hprintln!("foo2 {}", x).unwrap(); foo::spawn(x, 0).unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/t-cfg.rs b/examples/t-cfg.rs index 7076f5d..5bcef0a 100644 --- a/examples/t-cfg.rs +++ b/examples/t-cfg.rs @@ -5,7 +5,7 @@ use panic_halt as _; -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0, QEI0])] mod app { #[resources] struct Resources { @@ -47,12 +47,4 @@ mod app { #[cfg(never)] #[task] fn quux(_: quux::Context) {} - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - fn QEI0(); - } } diff --git a/examples/t-schedule-core-stable.rs b/examples/t-schedule-core-stable.rs index c2a8fdb..1053901 100644 --- a/examples/t-schedule-core-stable.rs +++ b/examples/t-schedule-core-stable.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { #[init] fn init(c: init::Context) -> init::LateResources { @@ -18,11 +18,4 @@ mod app { #[task] fn some_task(_: some_task::Context) {} - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index b1faaa6..9c94d1b 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use rtic::cyccnt::{Instant, U32Ext as _}; @@ -57,11 +57,4 @@ mod app { #[task] fn baz(_: baz::Context, _x: u32, _y: u32) {} - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/t-spawn.rs b/examples/t-spawn.rs index cf850e4..c9949ef 100644 --- a/examples/t-spawn.rs +++ b/examples/t-spawn.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { #[init] fn init(_: init::Context) -> init::LateResources { @@ -55,11 +55,4 @@ mod app { #[task] fn baz(_: baz::Context, _x: u32, _y: u32) {} - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/t-stask-main.rs b/examples/t-stask-main.rs index 56dc1af..034ad7c 100644 --- a/examples/t-stask-main.rs +++ b/examples/t-stask-main.rs @@ -5,7 +5,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::debug; @@ -20,11 +20,4 @@ mod app { fn taskmain(_: taskmain::Context) { debug::exit(debug::EXIT_SUCCESS); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } diff --git a/examples/task.rs b/examples/task.rs index 60591b9..5e4769a 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965, dispatchers = [SSI0, QEI0])] mod app { use cortex_m_semihosting::{debug, hprintln}; @@ -47,12 +47,4 @@ mod app { fn baz(_: baz::Context) { hprintln!("baz").unwrap(); } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - fn QEI0(); - } } diff --git a/examples/types.rs b/examples/types.rs index 815d309..9908dd6 100644 --- a/examples/types.rs +++ b/examples/types.rs @@ -7,7 +7,7 @@ use panic_semihosting as _; -#[rtic::app(device = lm3s6965, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, peripherals = true, monotonic = rtic::cyccnt::CYCCNT, dispatchers = [SSI0])] mod app { use cortex_m_semihosting::debug; use rtic::cyccnt; @@ -48,11 +48,4 @@ mod app { let _: &mut u32 = cx.resources.shared; let _: foo::Resources = cx.resources; } - - // RTIC requires that unused interrupts are declared in an extern block when - // using software tasks; these free interrupts will be used to dispatch the - // software tasks. - extern "C" { - fn SSI0(); - } } |
