aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/t-schedule-core-stable.rs28
-rw-r--r--macros/src/codegen/module.rs4
-rw-r--r--ui/single/locals-cfg.stderr8
-rw-r--r--ui/single/resources-cfg.stderr4
4 files changed, 36 insertions, 8 deletions
diff --git a/examples/t-schedule-core-stable.rs b/examples/t-schedule-core-stable.rs
new file mode 100644
index 0000000..c2a8fdb
--- /dev/null
+++ b/examples/t-schedule-core-stable.rs
@@ -0,0 +1,28 @@
+//! [compile-pass] Check `schedule` code generation
+
+#![deny(unsafe_code)]
+#![deny(warnings)]
+#![no_main]
+#![no_std]
+
+use panic_halt as _;
+
+#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)]
+mod app {
+ #[init]
+ fn init(c: init::Context) -> init::LateResources {
+ let _c: rtic::Peripherals = c.core;
+
+ init::LateResources {}
+ }
+
+ #[task]
+ fn some_task(_: some_task::Context) {}
+
+ // RTIC requires that unused interrupts are declared in an extern block when
+ // using software tasks; these free interrupts will be used to dispatch the
+ // software tasks.
+ extern "C" {
+ fn SSI0();
+ }
+}
diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs
index 2e51e7d..3d90cbd 100644
--- a/macros/src/codegen/module.rs
+++ b/macros/src/codegen/module.rs
@@ -15,7 +15,7 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) ->
let mut lt = None;
match ctxt {
Context::Init => {
- if app.uses_schedule() {
+ if extra.monotonic.is_some() {
let m = extra.monotonic();
fields.push(quote!(
@@ -277,7 +277,7 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) ->
};
let core = if ctxt.is_init() {
- if app.uses_schedule() {
+ if extra.monotonic.is_some() {
Some(quote!(core: rtic::Peripherals,))
} else {
Some(quote!(core: rtic::export::Peripherals,))
diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr
index e58bd93..53cdacc 100644
--- a/ui/single/locals-cfg.stderr
+++ b/ui/single/locals-cfg.stderr
@@ -31,11 +31,11 @@ error[E0425]: cannot find value `FOO` in this scope
error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `panic_impl`.
|
= note: the lang item is first defined in crate `std` (which `$CRATE` depends on)
- = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib
- = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
+ = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-f14aca24435a5414.rlib
+ = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-33949299fdfa2375.rmeta
error: duplicate lang item in crate `panic_semihosting`: `panic_impl`.
|
= note: the lang item is first defined in crate `panic_halt` (which `$CRATE` depends on)
- = note: first definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
- = note: second definition in `panic_semihosting` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_semihosting-805015f4a2d05965.rmeta
+ = note: first definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-33949299fdfa2375.rmeta
+ = note: second definition in `panic_semihosting` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_semihosting-f97442f9ee5cfc78.rmeta
diff --git a/ui/single/resources-cfg.stderr b/ui/single/resources-cfg.stderr
index 17f08d8..0b0c749 100644
--- a/ui/single/resources-cfg.stderr
+++ b/ui/single/resources-cfg.stderr
@@ -1,8 +1,8 @@
error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `panic_impl`.
|
= note: the lang item is first defined in crate `std` (which `$CRATE` depends on)
- = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib
- = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ba6f0ab3439cbc7e.rmeta
+ = note: first definition in `std` loaded from /usr/share/rust/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-f14aca24435a5414.rlib
+ = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-33949299fdfa2375.rmeta
error[E0609]: no field `o1` on type `initResources<'_>`
--> $DIR/resources-cfg.rs:47:21