diff options
author | 2019-08-21 10:17:27 +0200 | |
---|---|---|
committer | 2019-08-21 10:17:27 +0200 | |
commit | 07b2b4d83078d0fd260d5f0812e8d5a34d02b793 (patch) | |
tree | dba2a8e8316e8cd868ccb7b46a80d63c5f61a224 /examples/types.rs | |
parent | 0e146f8d1142672725b6abb38478f503a9261c80 (diff) | |
download | rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.gz rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.tar.zst rtic-07b2b4d83078d0fd260d5f0812e8d5a34d02b793.zip |
doc up
Diffstat (limited to 'examples/types.rs')
-rw-r--r-- | examples/types.rs | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/examples/types.rs b/examples/types.rs index 0c8097f3..fc391d07 100644 --- a/examples/types.rs +++ b/examples/types.rs @@ -7,7 +7,7 @@ use cortex_m_semihosting::debug; use panic_semihosting as _; -use rtfm::cyccnt::Instant; +use rtfm::cyccnt; #[rtfm::app(device = lm3s6965, peripherals = true, monotonic = rtfm::cyccnt::CYCCNT)] const APP: () = { @@ -17,38 +17,39 @@ const APP: () = { } #[init(schedule = [foo], spawn = [foo])] - fn init(c: init::Context) { - let _: Instant = c.start; - let _: rtfm::Peripherals = c.core; - let _: lm3s6965::Peripherals = c.device; - let _: init::Schedule = c.schedule; - let _: init::Spawn = c.spawn; + fn init(cx: init::Context) { + let _: cyccnt::Instant = cx.start; + let _: rtfm::Peripherals = cx.core; + let _: lm3s6965::Peripherals = cx.device; + let _: init::Schedule = cx.schedule; + let _: init::Spawn = cx.spawn; debug::exit(debug::EXIT_SUCCESS); } - #[task(binds = SVCall, schedule = [foo], spawn = [foo])] - fn svcall(c: svcall::Context) { - let _: Instant = c.start; - let _: svcall::Schedule = c.schedule; - let _: svcall::Spawn = c.spawn; + #[idle(schedule = [foo], spawn = [foo])] + fn idle(cx: idle::Context) -> ! { + let _: idle::Schedule = cx.schedule; + let _: idle::Spawn = cx.spawn; + + loop {} } #[task(binds = UART0, resources = [shared], schedule = [foo], spawn = [foo])] - fn uart0(c: uart0::Context) { - let _: Instant = c.start; - let _: resources::shared = c.resources.shared; - let _: uart0::Schedule = c.schedule; - let _: uart0::Spawn = c.spawn; + fn uart0(cx: uart0::Context) { + let _: cyccnt::Instant = cx.start; + let _: resources::shared = cx.resources.shared; + let _: uart0::Schedule = cx.schedule; + let _: uart0::Spawn = cx.spawn; } #[task(priority = 2, resources = [shared], schedule = [foo], spawn = [foo])] - fn foo(c: foo::Context) { - let _: Instant = c.scheduled; - let _: &mut u32 = c.resources.shared; - let _: foo::Resources = c.resources; - let _: foo::Schedule = c.schedule; - let _: foo::Spawn = c.spawn; + fn foo(cx: foo::Context) { + let _: cyccnt::Instant = cx.scheduled; + let _: &mut u32 = cx.resources.shared; + let _: foo::Resources = cx.resources; + let _: foo::Schedule = cx.schedule; + let _: foo::Spawn = cx.spawn; } extern "C" { |