diff options
| author | Henrik Tjäder <henrik@tjaders.com> | 2020-06-11 17:18:29 +0000 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2020-06-11 17:18:29 +0000 |
| commit | 602a5b4374961dbcf7f3290053ab9b01f0622c67 (patch) | |
| tree | d3e64006a7b310d34d82df7aa2a4467c03595e55 /examples | |
| parent | 4a0393f756cc3ccd480f839eb6b6a9349326fe8e (diff) | |
Rename RTFM to RTIC
Diffstat (limited to 'examples')
36 files changed, 67 insertions, 67 deletions
diff --git a/examples/baseline.rs b/examples/baseline.rs index df0ff9a..4be8cd3 100644 --- a/examples/baseline.rs +++ b/examples/baseline.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; // NOTE: does NOT properly work on QEMU -#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { #[init(spawn = [foo])] fn init(cx: init::Context) { @@ -31,7 +31,7 @@ const APP: () = { if *ONCE { *ONCE = false; - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); } else { debug::exit(debug::EXIT_SUCCESS); } diff --git a/examples/binds.rs b/examples/binds.rs index b10cb43..faf315f 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -10,11 +10,11 @@ use lm3s6965::Interrupt; use panic_semihosting as _; // `examples/interrupt.rs` rewritten to use `binds` -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); hprintln!("init").unwrap(); } @@ -23,7 +23,7 @@ const APP: () = { fn idle(_: idle::Context) -> ! { hprintln!("idle").unwrap(); - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); debug::exit(debug::EXIT_SUCCESS); diff --git a/examples/capacity.rs b/examples/capacity.rs index ebc86b8..e50f929 100644 --- a/examples/capacity.rs +++ b/examples/capacity.rs @@ -9,11 +9,11 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); } #[task(binds = UART0, spawn = [foo, bar])] diff --git a/examples/cfg.rs b/examples/cfg.rs index 2a43b5c..534c3f8 100644 --- a/examples/cfg.rs +++ b/examples/cfg.rs @@ -10,7 +10,7 @@ use cortex_m_semihosting::debug; use cortex_m_semihosting::hprintln; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { #[cfg(debug_assertions)] // <- `true` when using the `dev` profile diff --git a/examples/destructure.rs b/examples/destructure.rs index 0cc3c1f..1756bd9 100644 --- a/examples/destructure.rs +++ b/examples/destructure.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::hprintln; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { // Some resources to work with @@ -23,8 +23,8 @@ const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::UART0); - rtfm::pend(Interrupt::UART1); + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); } // Direct destructure diff --git a/examples/generics.rs b/examples/generics.rs index eafc630..40ab81a 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -8,9 +8,9 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -use rtfm::{Exclusive, Mutex}; +use rtic::{Exclusive, Mutex}; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { #[init(0)] @@ -19,8 +19,8 @@ const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::UART0); - rtfm::pend(Interrupt::UART1); + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); } #[task(binds = UART0, resources = [shared])] @@ -32,7 +32,7 @@ const APP: () = { // second argument has type `resources::shared` advance(STATE, c.resources.shared); - rtfm::pend(Interrupt::UART1); + rtic::pend(Interrupt::UART1); debug::exit(debug::EXIT_SUCCESS); } diff --git a/examples/hardware.rs b/examples/hardware.rs index 77f19d9..9f1c664 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -9,13 +9,13 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { // Pends the UART0 interrupt but its handler won't run until *after* // `init` returns because interrupts are disabled - rtfm::pend(Interrupt::UART0); // equivalent to NVIC::pend + rtic::pend(Interrupt::UART0); // equivalent to NVIC::pend hprintln!("init").unwrap(); } @@ -26,7 +26,7 @@ const APP: () = { hprintln!("idle").unwrap(); - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); debug::exit(debug::EXIT_SUCCESS); diff --git a/examples/idle.rs b/examples/idle.rs index c6f676b..c09af92 100644 --- a/examples/idle.rs +++ b/examples/idle.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { diff --git a/examples/init.rs b/examples/init.rs index 194e3ec..315969f 100644 --- a/examples/init.rs +++ b/examples/init.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965, peripherals = true)] +#[rtic::app(device = lm3s6965, peripherals = true)] const APP: () = { #[init] fn init(cx: init::Context) { diff --git a/examples/late.rs b/examples/late.rs index 2eb12d6..60b9be0 100644 --- a/examples/late.rs +++ b/examples/late.rs @@ -14,7 +14,7 @@ use heapless::{ use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { // Late resources struct Resources { @@ -40,7 +40,7 @@ const APP: () = { debug::exit(debug::EXIT_SUCCESS); } else { - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); } } } diff --git a/examples/lock.rs b/examples/lock.rs index f33a60a..5e3bce2 100644 --- a/examples/lock.rs +++ b/examples/lock.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { #[init(0)] @@ -18,7 +18,7 @@ const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::GPIOA); + rtic::pend(Interrupt::GPIOA); } // when omitted priority is assumed to be `1` @@ -32,12 +32,12 @@ const APP: () = { *shared += 1; // GPIOB will *not* run right now due to the critical section - rtfm::pend(Interrupt::GPIOB); + rtic::pend(Interrupt::GPIOB); hprintln!("B - shared = {}", *shared).unwrap(); // GPIOC does not contend for `shared` so it's allowed to run now - rtfm::pend(Interrupt::GPIOC); + rtic::pend(Interrupt::GPIOC); }); // critical section is over: GPIOB can now start diff --git a/examples/message.rs b/examples/message.rs index 8bfed52..3fb2812 100644 --- a/examples/message.rs +++ b/examples/message.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init(spawn = [foo])] fn init(c: init::Context) { diff --git a/examples/not-send.rs b/examples/not-send.rs index d27cc82..fc2196c 100644 --- a/examples/not-send.rs +++ b/examples/not-send.rs @@ -9,7 +9,7 @@ use core::marker::PhantomData; use cortex_m_semihosting::debug; use panic_halt as _; -use rtfm::app; +use rtic::app; pub struct NotSend { _0: PhantomData<*const ()>, diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 7ce2a82..57b18d7 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -14,7 +14,7 @@ pub struct NotSync { _0: PhantomData<*const ()>, } -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { #[init(NotSync { _0: PhantomData })] diff --git a/examples/only-shared-access.rs b/examples/only-shared-access.rs index c7060b1..c022b03 100644 --- a/examples/only-shared-access.rs +++ b/examples/only-shared-access.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { key: u32, @@ -17,8 +17,8 @@ const APP: () = { #[init] fn init(_: init::Context) -> init::LateResources { - rtfm::pend(Interrupt::UART0); - rtfm::pend(Interrupt::UART1); + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); init::LateResources { key: 0xdeadbeef } } diff --git a/examples/periodic.rs b/examples/periodic.rs index 3d32bc2..f84744a 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -7,12 +7,12 @@ use cortex_m_semihosting::hprintln; use panic_semihosting as _; -use rtfm::cyccnt::{Instant, U32Ext}; +use rtic::cyccnt::{Instant, U32Ext}; const PERIOD: u32 = 8_000_000; // NOTE: does NOT work on QEMU! -#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { #[init(schedule = [foo])] fn init(cx: init::Context) { diff --git a/examples/pool.rs b/examples/pool.rs index 8c44cb1..38d2b6e 100644 --- a/examples/pool.rs +++ b/examples/pool.rs @@ -12,7 +12,7 @@ use heapless::{ }; use lm3s6965::Interrupt; use panic_semihosting as _; -use rtfm::app; +use rtic::app; // Declare a pool of 128-byte memory blocks pool!(P: [u8; 128]); @@ -26,7 +26,7 @@ const APP: () = { // Increase the capacity of the memory pool by ~4 P::grow(MEMORY); - rtfm::pend(Interrupt::I2C0); + rtic::pend(Interrupt::I2C0); } #[task(binds = I2C0, priority = 2, spawn = [foo, bar])] diff --git a/examples/preempt.rs b/examples/preempt.rs index d7a7e64..3cb1102 100644 --- a/examples/preempt.rs +++ b/examples/preempt.rs @@ -6,19 +6,19 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -use rtfm::app; +use rtic::app; #[app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::GPIOA); + rtic::pend(Interrupt::GPIOA); } #[task(binds = GPIOA, priority = 1)] fn gpioa(_: gpioa::Context) { hprintln!("GPIOA - start").unwrap(); - rtfm::pend(Interrupt::GPIOC); + rtic::pend(Interrupt::GPIOC); hprintln!("GPIOA - end").unwrap(); debug::exit(debug::EXIT_SUCCESS); } @@ -31,7 +31,7 @@ const APP: () = { #[task(binds = GPIOC, priority = 2)] fn gpioc(_: gpioc::Context) { hprintln!(" GPIOC - start").unwrap(); - rtfm::pend(Interrupt::GPIOB); + rtic::pend(Interrupt::GPIOB); hprintln!(" GPIOC - end").unwrap(); } }; diff --git a/examples/ramfunc.rs b/examples/ramfunc.rs index c38635f..1f95d49 100644 --- a/examples/ramfunc.rs +++ b/examples/ramfunc.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init(spawn = [bar])] fn init(c: init::Context) { diff --git a/examples/resource.rs b/examples/resource.rs index 8632525..ded97f8 100644 --- a/examples/resource.rs +++ b/examples/resource.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use lm3s6965::Interrupt; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { // A resource @@ -19,8 +19,8 @@ const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(Interrupt::UART0); - rtfm::pend(Interrupt::UART1); + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); } // `shared` cannot be accessed from this context diff --git a/examples/schedule.rs b/examples/schedule.rs index d5de9db..44a5693 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -8,10 +8,10 @@ use cortex_m::peripheral::DWT; use cortex_m_semihosting::hprintln; use panic_halt as _; -use rtfm::cyccnt::{Instant, U32Ext as _}; +use rtic::cyccnt::{Instant, U32Ext as _}; // NOTE: does NOT work on QEMU! -#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { #[init(schedule = [foo, bar])] fn init(mut cx: init::Context) { diff --git a/examples/shared-with-init.rs b/examples/shared-with-init.rs index 14fa54b..bd55f7e 100644 --- a/examples/shared-with-init.rs +++ b/examples/shared-with-init.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::debug; use lm3s6965::Interrupt; use panic_halt as _; -use rtfm::app; +use rtic::app; pub struct MustBeSend; @@ -25,7 +25,7 @@ const APP: () = { let message = MustBeSend; *c.resources.shared = Some(message); - rtfm::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART0); } #[task(binds = UART0, resources = [shared])] diff --git a/examples/smallest.rs b/examples/smallest.rs index 7b26a85..ec3fa97 100644 --- a/examples/smallest.rs +++ b/examples/smallest.rs @@ -4,7 +4,7 @@ #![no_std] use panic_semihosting as _; // panic handler -use rtfm::app; +use rtic::app; #[app(device = lm3s6965)] const APP: () = {}; diff --git a/examples/t-binds.rs b/examples/t-binds.rs index dda8e20..588ac46 100644 --- a/examples/t-binds.rs +++ b/examples/t-binds.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) {} diff --git a/examples/t-cfg-resources.rs b/examples/t-cfg-resources.rs index a8efe79..eb00fe5 100644 --- a/examples/t-cfg-resources.rs +++ b/examples/t-cfg-resources.rs @@ -5,7 +5,7 @@ use panic_halt as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { // A resource diff --git a/examples/t-cfg.rs b/examples/t-cfg.rs index e61ec79..feb7114 100644 --- a/examples/t-cfg.rs +++ b/examples/t-cfg.rs @@ -5,7 +5,7 @@ use panic_halt as _; -#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { struct Resources { #[cfg(never)] diff --git a/examples/t-htask-main.rs b/examples/t-htask-main.rs index d229d81..c4bebf9 100644 --- a/examples/t-htask-main.rs +++ b/examples/t-htask-main.rs @@ -6,11 +6,11 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) { - rtfm::pend(lm3s6965::Interrupt::UART0) + rtic::pend(lm3s6965::Interrupt::UART0) } #[task(binds = UART0)] diff --git a/examples/t-idle-main.rs b/examples/t-idle-main.rs index 861bbf2..94a3317 100644 --- a/examples/t-idle-main.rs +++ b/examples/t-idle-main.rs @@ -6,7 +6,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn init(_: init::Context) {} diff --git a/examples/t-init-main.rs b/examples/t-init-main.rs index e0d94d5..6a6cd99 100644 --- a/examples/t-init-main.rs +++ b/examples/t-init-main.rs @@ -6,7 +6,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init] fn main(_: main::Context) { diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs index 4fd3504..c464e73 100644 --- a/examples/t-late-not-send.rs +++ b/examples/t-late-not-send.rs @@ -11,7 +11,7 @@ pub struct NotSend { _0: PhantomData<*const ()>, } -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { x: NotSend, diff --git a/examples/t-resource.rs b/examples/t-resource.rs index 303340e..53665dc 100644 --- a/examples/t-resource.rs +++ b/examples/t-resource.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { struct Resources { #[init(0)] diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index e6035b3..67fcb74 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -6,9 +6,9 @@ #![no_std] use panic_halt as _; -use rtfm::cyccnt::{Instant, U32Ext as _}; +use rtic::cyccnt::{Instant, U32Ext as _}; -#[rtfm::app(device = lm3s6965, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { #[init(schedule = [foo, bar, baz])] fn init(c: init::Context) { diff --git a/examples/t-spawn.rs b/examples/t-spawn.rs index 682b9b8..4fc1f4e 100644 --- a/examples/t-spawn.rs +++ b/examples/t-spawn.rs @@ -7,7 +7,7 @@ use panic_halt as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init(spawn = [foo, bar, baz])] fn init(c: init::Context) { diff --git a/examples/t-stask-main.rs b/examples/t-stask-main.rs index b55161e..4245ef2 100644 --- a/examples/t-stask-main.rs +++ b/examples/t-stask-main.rs @@ -6,7 +6,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init(spawn = [main])] fn init(cx: init::Context) { diff --git a/examples/task.rs b/examples/task.rs index 9e563d7..10a4dc7 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -8,7 +8,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; -#[rtfm::app(device = lm3s6965)] +#[rtic::app(device = lm3s6965)] const APP: () = { #[init(spawn = [foo])] fn init(c: init::Context) { diff --git a/examples/types.rs b/examples/types.rs index fc391d0..29dedaf 100644 --- a/examples/types.rs +++ b/examples/types.rs @@ -7,9 +7,9 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -use rtfm::cyccnt; +use rtic::cyccnt; -#[rtfm::app(device = lm3s6965, peripherals = true, monotonic = rtfm::cyccnt::CYCCNT)] +#[rtic::app(device = lm3s6965, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)] const APP: () = { struct Resources { #[init(0)] @@ -19,7 +19,7 @@ const APP: () = { #[init(schedule = [foo], spawn = [foo])] fn init(cx: init::Context) { let _: cyccnt::Instant = cx.start; - let _: rtfm::Peripherals = cx.core; + let _: rtic::Peripherals = cx.core; let _: lm3s6965::Peripherals = cx.device; let _: init::Schedule = cx.schedule; let _: init::Spawn = cx.spawn; |
