diff options
| author | Henrik Tjäder <henrik@tjaders.com> | 2020-05-19 18:00:13 +0000 |
|---|---|---|
| committer | Henrik Tjäder <henrik@tjaders.com> | 2020-09-25 14:29:34 +0000 |
| commit | 5cfd9b92384a6e2d352e35de9da1b7a2b53cc2ea (patch) | |
| tree | ec271ee6f0e88df4ba3294f99bef817c07e683cd /examples | |
| parent | c718413cb56f9c25d79c71e607079561923b1a05 (diff) | |
Modules using lower-case in examples
Diffstat (limited to 'examples')
37 files changed, 41 insertions, 38 deletions
diff --git a/examples/baseline.rs b/examples/baseline.rs index 2d75dfa..e517bf0 100644 --- a/examples/baseline.rs +++ b/examples/baseline.rs @@ -11,7 +11,7 @@ use panic_semihosting as _; // NOTE: does NOT properly work on QEMU #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { #[init(spawn = [foo])] fn init(cx: init::Context) { // omitted: initialization of `CYCCNT` diff --git a/examples/binds.rs b/examples/binds.rs index 920124c..9c73433 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -11,7 +11,7 @@ use panic_semihosting as _; // `examples/interrupt.rs` rewritten to use `binds` #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { rtic::pend(Interrupt::UART0); diff --git a/examples/capacity.rs b/examples/capacity.rs index 26c61a2..7ccb086 100644 --- a/examples/capacity.rs +++ b/examples/capacity.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { rtic::pend(Interrupt::UART0); diff --git a/examples/cfg.rs b/examples/cfg.rs index 626181d..16e6e07 100644 --- a/examples/cfg.rs +++ b/examples/cfg.rs @@ -11,7 +11,7 @@ use cortex_m_semihosting::hprintln; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[cfg(debug_assertions)] // <- `true` when using the `dev` profile #[init(0)] diff --git a/examples/destructure.rs b/examples/destructure.rs index da0a4c1..131c07f 100644 --- a/examples/destructure.rs +++ b/examples/destructure.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { // Some resources to work with #[init(0)] diff --git a/examples/generics.rs b/examples/generics.rs index b67ed9c..20e9ed7 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -11,7 +11,7 @@ use panic_semihosting as _; use rtic::{Exclusive, Mutex}; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(0)] shared: u32, diff --git a/examples/hardware.rs b/examples/hardware.rs index 7926650..831b029 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { // Pends the UART0 interrupt but its handler won't run until *after* diff --git a/examples/idle.rs b/examples/idle.rs index dbf7f98..0db0545 100644 --- a/examples/idle.rs +++ b/examples/idle.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { hprintln!("init").unwrap(); diff --git a/examples/init.rs b/examples/init.rs index c651136..aaf71f9 100644 --- a/examples/init.rs +++ b/examples/init.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965, peripherals = true)] -mod APP { +mod app { #[init] fn init(cx: init::Context) { static mut X: u32 = 0; diff --git a/examples/late.rs b/examples/late.rs index 8675c6a..f656efb 100644 --- a/examples/late.rs +++ b/examples/late.rs @@ -15,7 +15,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { // Late resources struct Resources { p: Producer<'static, u32, U4>, diff --git a/examples/lock.rs b/examples/lock.rs index 4b16679..61aed21 100644 --- a/examples/lock.rs +++ b/examples/lock.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(0)] shared: u32, diff --git a/examples/message.rs b/examples/message.rs index 3e9633b..3f14a5a 100644 --- a/examples/message.rs +++ b/examples/message.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init(spawn = [foo])] fn init(c: init::Context) { c.spawn.foo(/* no message */).unwrap(); diff --git a/examples/not-send.rs b/examples/not-send.rs index bcc049c..a296594 100644 --- a/examples/not-send.rs +++ b/examples/not-send.rs @@ -16,7 +16,7 @@ pub struct NotSend { } #[app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(None)] shared: Option<NotSend>, diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 0354ef1..7415621 100644 --- a/examples/not-sync.rs +++ b/examples/not-sync.rs @@ -15,7 +15,7 @@ pub struct NotSync { } #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(NotSync { _0: PhantomData })] shared: NotSync, diff --git a/examples/only-shared-access.rs b/examples/only-shared-access.rs index fbc7bfd..221cc30 100644 --- a/examples/only-shared-access.rs +++ b/examples/only-shared-access.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { key: u32, } diff --git a/examples/periodic.rs b/examples/periodic.rs index cd887ca..2d4c73b 100644 --- a/examples/periodic.rs +++ b/examples/periodic.rs @@ -13,7 +13,8 @@ const PERIOD: u32 = 8_000_000; // NOTE: does NOT work on QEMU! #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { + #[init(schedule = [foo])] fn init(cx: init::Context) { // omitted: initialization of `CYCCNT` diff --git a/examples/peripherals-taken.rs b/examples/peripherals-taken.rs index a1bd686..b9267df 100644 --- a/examples/peripherals-taken.rs +++ b/examples/peripherals-taken.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn main(_: main::Context) { assert!(cortex_m::Peripherals::take().is_none()); diff --git a/examples/pool.rs b/examples/pool.rs index eb65ed8..c87be77 100644 --- a/examples/pool.rs +++ b/examples/pool.rs @@ -18,7 +18,10 @@ use rtic::app; pool!(P: [u8; 128]); #[app(device = lm3s6965)] -mod APP { +mod app { + use crate::Box; + use crate::P; + #[init] fn init(_: init::Context) { static mut MEMORY: [u8; 512] = [0; 512]; diff --git a/examples/preempt.rs b/examples/preempt.rs index a20b36c..0219301 100644 --- a/examples/preempt.rs +++ b/examples/preempt.rs @@ -9,7 +9,7 @@ use panic_semihosting as _; use rtic::app; #[app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { rtic::pend(Interrupt::GPIOA); diff --git a/examples/ramfunc.rs b/examples/ramfunc.rs index cfe22e3..789d787 100644 --- a/examples/ramfunc.rs +++ b/examples/ramfunc.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init(spawn = [bar])] fn init(c: init::Context) { c.spawn.bar().unwrap(); diff --git a/examples/resource.rs b/examples/resource.rs index a0954d6..4887b5e 100644 --- a/examples/resource.rs +++ b/examples/resource.rs @@ -10,7 +10,7 @@ use lm3s6965::Interrupt; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { // A resource #[init(0)] diff --git a/examples/schedule.rs b/examples/schedule.rs index f2e7ed8..d5547b6 100644 --- a/examples/schedule.rs +++ b/examples/schedule.rs @@ -12,7 +12,7 @@ use rtic::cyccnt::{Instant, U32Ext as _}; // NOTE: does NOT work on QEMU! #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { #[init(schedule = [foo, bar])] fn init(mut cx: init::Context) { // Initialize (enable) the monotonic timer (CYCCNT) diff --git a/examples/shared-with-init.rs b/examples/shared-with-init.rs index 03391bd..dcc31d3 100644 --- a/examples/shared-with-init.rs +++ b/examples/shared-with-init.rs @@ -13,7 +13,7 @@ use rtic::app; pub struct MustBeSend; #[app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(None)] shared: Option<MustBeSend>, diff --git a/examples/smallest.rs b/examples/smallest.rs index d6f3b66..b8cbf87 100644 --- a/examples/smallest.rs +++ b/examples/smallest.rs @@ -7,4 +7,4 @@ use panic_semihosting as _; // panic handler use rtic::app; #[app(device = lm3s6965)] -mod APP {} +mod app {} diff --git a/examples/t-binds.rs b/examples/t-binds.rs index 8634c75..7d7bd7d 100644 --- a/examples/t-binds.rs +++ b/examples/t-binds.rs @@ -8,7 +8,7 @@ use panic_halt as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) {} diff --git a/examples/t-cfg-resources.rs b/examples/t-cfg-resources.rs index 892d211..cf1c684 100644 --- a/examples/t-cfg-resources.rs +++ b/examples/t-cfg-resources.rs @@ -6,12 +6,11 @@ use panic_halt as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { // A resource #[init(0)] shared: u32, - // A conditionally compiled resource behind feature_x #[cfg(feature = "feature_x")] x: u32, diff --git a/examples/t-cfg.rs b/examples/t-cfg.rs index da9a491..7caabe2 100644 --- a/examples/t-cfg.rs +++ b/examples/t-cfg.rs @@ -6,7 +6,7 @@ use panic_halt as _; #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { struct Resources { #[cfg(never)] #[init(0)] diff --git a/examples/t-htask-main.rs b/examples/t-htask-main.rs index 6143bbd..1954d56 100644 --- a/examples/t-htask-main.rs +++ b/examples/t-htask-main.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { rtic::pend(lm3s6965::Interrupt::UART0) diff --git a/examples/t-idle-main.rs b/examples/t-idle-main.rs index 89f93d0..8400f31 100644 --- a/examples/t-idle-main.rs +++ b/examples/t-idle-main.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) {} diff --git a/examples/t-init-main.rs b/examples/t-init-main.rs index 040c72f..b4f126b 100644 --- a/examples/t-init-main.rs +++ b/examples/t-init-main.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn main(_: main::Context) { debug::exit(debug::EXIT_SUCCESS); diff --git a/examples/t-late-not-send.rs b/examples/t-late-not-send.rs index 7799018..4f6d1af 100644 --- a/examples/t-late-not-send.rs +++ b/examples/t-late-not-send.rs @@ -12,7 +12,7 @@ pub struct NotSend { } #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { x: NotSend, #[init(None)] diff --git a/examples/t-resource.rs b/examples/t-resource.rs index 0864a8a..e18a1cd 100644 --- a/examples/t-resource.rs +++ b/examples/t-resource.rs @@ -8,7 +8,7 @@ use panic_halt as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[init(0)] o1: u32, // init diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index 6753613..ef2eb08 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -9,7 +9,7 @@ use panic_halt as _; use rtic::cyccnt::{Instant, U32Ext as _}; #[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { #[init(schedule = [foo, bar, baz])] fn init(c: init::Context) { let _: Result<(), ()> = c.schedule.foo(c.start + 10.cycles()); diff --git a/examples/t-spawn.rs b/examples/t-spawn.rs index 7a64e1c..72143c5 100644 --- a/examples/t-spawn.rs +++ b/examples/t-spawn.rs @@ -8,7 +8,7 @@ use panic_halt as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init(spawn = [foo, bar, baz])] fn init(c: init::Context) { let _: Result<(), ()> = c.spawn.foo(); diff --git a/examples/t-stask-main.rs b/examples/t-stask-main.rs index edea430..373b505 100644 --- a/examples/t-stask-main.rs +++ b/examples/t-stask-main.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init(spawn = [main])] fn init(cx: init::Context) { cx.spawn.main().ok(); diff --git a/examples/task.rs b/examples/task.rs index e515c93..f510df7 100644 --- a/examples/task.rs +++ b/examples/task.rs @@ -9,7 +9,7 @@ use cortex_m_semihosting::{debug, hprintln}; use panic_semihosting as _; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init(spawn = [foo])] fn init(c: init::Context) { c.spawn.foo().unwrap(); diff --git a/examples/types.rs b/examples/types.rs index eafc9b1..8c612b2 100644 --- a/examples/types.rs +++ b/examples/types.rs @@ -10,7 +10,7 @@ use panic_semihosting as _; use rtic::cyccnt; #[rtic::app(device = lm3s6965, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)] -mod APP { +mod app { struct Resources { #[init(0)] shared: u32, |
