diff --git a/examples/baseline.rs b/examples/baseline.rs index 2d75dfaa45..e517bf080d 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 920124cf32..9c73433b06 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 26c61a250a..7ccb086af4 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 626181de3b..16e6e077aa 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 da0a4c1d0e..131c07fbf6 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 b67ed9ca39..20e9ed7f20 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 7926650c1f..831b029cbc 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 dbf7f983bf..0db05459b1 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 c651136e4f..aaf71f9784 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 8675c6ac73..f656efba37 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 4b16679e9b..61aed21355 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 3e9633bd2f..3f14a5a47f 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 bcc049c326..a2965941fc 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, diff --git a/examples/not-sync.rs b/examples/not-sync.rs index 0354ef1015..741562115b 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 fbc7bfd42a..221cc307b1 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 cd887ca52e..2d4c73b50d 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 a1bd686832..b9267df62f 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 eb65ed8271..c87be77848 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 a20b36ccb5..0219301120 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 cfe22e392d..789d78718f 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 a0954d604d..4887b5eff2 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 f2e7ed8804..d5547b674b 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 03391bddc1..dcc31d3c55 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, diff --git a/examples/smallest.rs b/examples/smallest.rs index d6f3b66cc2..b8cbf87ed5 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 8634c7595c..7d7bd7d2d1 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 892d211450..cf1c6849a9 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 da9a49109d..7caabe2c69 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 6143bbd73f..1954d56da0 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 89f93d0a98..8400f31454 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 040c72fa19..b4f126ba92 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 77990182b5..4f6d1af7f4 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 0864a8ab27..e18a1cd7ac 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 6753613356..ef2eb080e9 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 7a64e1ccf4..72143c5b25 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 edea4309ee..373b505c92 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 e515c936cc..f510df7450 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 eafc9b1d1d..8c612b21ff 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, diff --git a/ui/single/exception-invalid.rs b/ui/single/exception-invalid.rs index 9b6b0016d4..04d9bc75f0 100644 --- a/ui/single/exception-invalid.rs +++ b/ui/single/exception-invalid.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[task(binds = NonMaskableInt)] fn nmi(_: nmi::Context) {} } diff --git a/ui/single/exception-systick-used.rs b/ui/single/exception-systick-used.rs index 02fd1c6bca..1c30b7004b 100644 --- a/ui/single/exception-systick-used.rs +++ b/ui/single/exception-systick-used.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[task(binds = SysTick)] fn sys_tick(_: sys_tick::Context) {} diff --git a/ui/single/extern-interrupt-not-enough.rs b/ui/single/extern-interrupt-not-enough.rs index 18850d8ace..f262403640 100644 --- a/ui/single/extern-interrupt-not-enough.rs +++ b/ui/single/extern-interrupt-not-enough.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[task] fn a(_: a::Context) {} } diff --git a/ui/single/extern-interrupt-used.rs b/ui/single/extern-interrupt-used.rs index dd798431a4..89c2378460 100644 --- a/ui/single/extern-interrupt-used.rs +++ b/ui/single/extern-interrupt-used.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[task(binds = UART0)] fn a(_: a::Context) {} diff --git a/ui/single/locals-cfg.rs b/ui/single/locals-cfg.rs index 5053cf38c1..7ec46acbfe 100644 --- a/ui/single/locals-cfg.rs +++ b/ui/single/locals-cfg.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) { #[cfg(never)] diff --git a/ui/single/resources-cfg.rs b/ui/single/resources-cfg.rs index fd03f58536..e41ce4215b 100644 --- a/ui/single/resources-cfg.rs +++ b/ui/single/resources-cfg.rs @@ -1,7 +1,7 @@ #![no_main] #[rtic::app(device = lm3s6965)] -mod APP { +mod app { struct Resources { #[cfg(never)] #[init(0)] diff --git a/ui/single/task-priority-too-high.rs b/ui/single/task-priority-too-high.rs index ed7dd8696c..c01d685b39 100644 --- a/ui/single/task-priority-too-high.rs +++ b/ui/single/task-priority-too-high.rs @@ -3,7 +3,7 @@ use rtic::app; #[rtic::app(device = lm3s6965)] -mod APP { +mod app { #[init] fn init(_: init::Context) {}