mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-12-24 02:49:34 +01:00
Modules using lower-case in examples
This commit is contained in:
parent
c718413cb5
commit
5cfd9b9238
44 changed files with 48 additions and 45 deletions
|
@ -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`
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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*
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -16,7 +16,7 @@ pub struct NotSend {
|
|||
}
|
||||
|
||||
#[app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
#[init(None)]
|
||||
shared: Option<NotSend>,
|
||||
|
|
|
@ -15,7 +15,7 @@ pub struct NotSync {
|
|||
}
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
#[init(NotSync { _0: PhantomData })]
|
||||
shared: NotSync,
|
||||
|
|
|
@ -10,7 +10,7 @@ use lm3s6965::Interrupt;
|
|||
use panic_semihosting as _;
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
key: u32,
|
||||
}
|
||||
|
|
|
@ -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`
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -13,7 +13,7 @@ use rtic::app;
|
|||
pub struct MustBeSend;
|
||||
|
||||
#[app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
#[init(None)]
|
||||
shared: Option<MustBeSend>,
|
||||
|
|
|
@ -7,4 +7,4 @@ use panic_semihosting as _; // panic handler
|
|||
use rtic::app;
|
||||
|
||||
#[app(device = lm3s6965)]
|
||||
mod APP {}
|
||||
mod app {}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
use panic_halt as _;
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[init]
|
||||
fn init(_: init::Context) {}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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) {}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -12,7 +12,7 @@ pub struct NotSend {
|
|||
}
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
x: NotSend,
|
||||
#[init(None)]
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
use panic_halt as _;
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
#[init(0)]
|
||||
o1: u32, // init
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[task(binds = NonMaskableInt)]
|
||||
fn nmi(_: nmi::Context) {}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[task(binds = SysTick)]
|
||||
fn sys_tick(_: sys_tick::Context) {}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[task]
|
||||
fn a(_: a::Context) {}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[task(binds = UART0)]
|
||||
fn a(_: a::Context) {}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[init]
|
||||
fn init(_: init::Context) {
|
||||
#[cfg(never)]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#![no_main]
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
struct Resources {
|
||||
#[cfg(never)]
|
||||
#[init(0)]
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
use rtic::app;
|
||||
|
||||
#[rtic::app(device = lm3s6965)]
|
||||
mod APP {
|
||||
mod app {
|
||||
#[init]
|
||||
fn init(_: init::Context) {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue