Modules using lower-case in examples

This commit is contained in:
Henrik Tjäder 2020-05-19 18:00:13 +00:00
parent c718413cb5
commit 5cfd9b9238
44 changed files with 48 additions and 45 deletions

View file

@ -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`

View file

@ -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);

View file

@ -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);

View file

@ -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)]

View file

@ -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)]

View file

@ -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,

View file

@ -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*

View file

@ -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();

View file

@ -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;

View file

@ -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>,

View file

@ -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,

View file

@ -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();

View file

@ -16,7 +16,7 @@ pub struct NotSend {
}
#[app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
#[init(None)]
shared: Option<NotSend>,

View file

@ -15,7 +15,7 @@ pub struct NotSync {
}
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
#[init(NotSync { _0: PhantomData })]
shared: NotSync,

View file

@ -10,7 +10,7 @@ use lm3s6965::Interrupt;
use panic_semihosting as _;
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
key: u32,
}

View file

@ -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`

View file

@ -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());

View file

@ -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];

View file

@ -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);

View file

@ -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();

View file

@ -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)]

View file

@ -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)

View file

@ -13,7 +13,7 @@ use rtic::app;
pub struct MustBeSend;
#[app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
#[init(None)]
shared: Option<MustBeSend>,

View file

@ -7,4 +7,4 @@ use panic_semihosting as _; // panic handler
use rtic::app;
#[app(device = lm3s6965)]
mod APP {}
mod app {}

View file

@ -8,7 +8,7 @@
use panic_halt as _;
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[init]
fn init(_: init::Context) {}

View file

@ -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,

View file

@ -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)]

View file

@ -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)

View file

@ -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) {}

View file

@ -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);

View file

@ -12,7 +12,7 @@ pub struct NotSend {
}
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
x: NotSend,
#[init(None)]

View file

@ -8,7 +8,7 @@
use panic_halt as _;
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
#[init(0)]
o1: u32, // init

View file

@ -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());

View file

@ -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();

View file

@ -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();

View file

@ -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();

View file

@ -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,

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[task(binds = NonMaskableInt)]
fn nmi(_: nmi::Context) {}
}

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[task(binds = SysTick)]
fn sys_tick(_: sys_tick::Context) {}

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[task]
fn a(_: a::Context) {}
}

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[task(binds = UART0)]
fn a(_: a::Context) {}

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[init]
fn init(_: init::Context) {
#[cfg(never)]

View file

@ -1,7 +1,7 @@
#![no_main]
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
struct Resources {
#[cfg(never)]
#[init(0)]

View file

@ -3,7 +3,7 @@
use rtic::app;
#[rtic::app(device = lm3s6965)]
mod APP {
mod app {
#[init]
fn init(_: init::Context) {}