From 210197d07955e760c031e05d1cc79689290335dc Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 23 Feb 2021 19:29:15 +0100 Subject: Remove flags, updates UI tests --- ui/single/exception-systick-used.rs | 7 ------- ui/single/exception-systick-used.stderr | 5 ----- ui/single/local-cfg-task-local-err.rs | 17 ++++++++++------- ui/single/local-err.rs | 4 ++-- ui/single/locals-cfg.rs | 4 ++-- ui/single/resources-cfg.rs | 4 ++-- ui/single/task-priority-too-high.rs | 4 ++-- 7 files changed, 18 insertions(+), 27 deletions(-) delete mode 100644 ui/single/exception-systick-used.rs delete mode 100644 ui/single/exception-systick-used.stderr (limited to 'ui/single') diff --git a/ui/single/exception-systick-used.rs b/ui/single/exception-systick-used.rs deleted file mode 100644 index 9e94c73..0000000 --- a/ui/single/exception-systick-used.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![no_main] - -#[rtic::app(device = lm3s6965, monotonic = rtic::cyccnt::CYCCNT)] -mod app { - #[task(binds = SysTick)] - fn sys_tick(_: sys_tick::Context) {} -} diff --git a/ui/single/exception-systick-used.stderr b/ui/single/exception-systick-used.stderr deleted file mode 100644 index 23b6dc4..0000000 --- a/ui/single/exception-systick-used.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: this exception can't be used because it's being used by the runtime - --> $DIR/exception-systick-used.rs:6:8 - | -6 | fn sys_tick(_: sys_tick::Context) {} - | ^^^^^^^^ diff --git a/ui/single/local-cfg-task-local-err.rs b/ui/single/local-cfg-task-local-err.rs index 412f614..d4752ed 100644 --- a/ui/single/local-cfg-task-local-err.rs +++ b/ui/single/local-cfg-task-local-err.rs @@ -26,15 +26,18 @@ mod app { } #[init] - fn init(_: init::Context) -> init::LateResources { + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { rtic::pend(Interrupt::UART0); rtic::pend(Interrupt::UART1); - init::LateResources { - #[cfg(feature = "feature_l2")] - l2: 2, - #[cfg(not(feature = "feature_l2"))] - l2: 5, - } + ( + init::LateResources { + #[cfg(feature = "feature_l2")] + l2: 2, + #[cfg(not(feature = "feature_l2"))] + l2: 5, + }, + init::Monotonics(), + ) } // l1 ok (task_local) diff --git a/ui/single/local-err.rs b/ui/single/local-err.rs index 0fe98a4..7ebfc06 100644 --- a/ui/single/local-err.rs +++ b/ui/single/local-err.rs @@ -39,10 +39,10 @@ mod app { } #[init] - fn init(_: init::Context) -> init::LateResources { + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { rtic::pend(Interrupt::UART0); rtic::pend(Interrupt::UART1); - init::LateResources { e2: 2, l2: 2 } + (init::LateResources { e2: 2, l2: 2 }, init::Monotonics()) } // `shared` cannot be accessed from this context diff --git a/ui/single/locals-cfg.rs b/ui/single/locals-cfg.rs index 3bfdaa1..72e2aca 100644 --- a/ui/single/locals-cfg.rs +++ b/ui/single/locals-cfg.rs @@ -4,13 +4,13 @@ use panic_halt as _; #[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { #[init] - fn init(_: init::Context) -> init::LateResources { + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { #[cfg(never)] static mut FOO: u32 = 0; FOO; - init::LateResources {} + (init::LateResources {}, init::Monotonics()) } #[idle] diff --git a/ui/single/resources-cfg.rs b/ui/single/resources-cfg.rs index 2ba65a0..c11d2ba 100644 --- a/ui/single/resources-cfg.rs +++ b/ui/single/resources-cfg.rs @@ -43,14 +43,14 @@ mod app { } #[init(resources = [o1, o4, o5, o6, s3])] - fn init(c: init::Context) -> init::LateResources { + fn init(c: init::Context) -> (init::LateResources, init::Monotonics) { c.resources.o1; c.resources.o4; c.resources.o5; c.resources.o6; c.resources.s3; - init::LateResources {} + (init::LateResources {}, init::Monotonics()) } #[idle(resources = [o2, &o4, s1, &s3])] diff --git a/ui/single/task-priority-too-high.rs b/ui/single/task-priority-too-high.rs index caa7b8e..b1cbfa9 100644 --- a/ui/single/task-priority-too-high.rs +++ b/ui/single/task-priority-too-high.rs @@ -3,8 +3,8 @@ #[rtic::app(device = lm3s6965)] mod app { #[init] - fn init(_: init::Context) -> init::LateResources { - init::LateResources {} + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + (init::LateResources {}, init::Monotonics()) } #[task(binds = GPIOA, priority = 1)] -- cgit v1.2.3 From 670cdb92d3a22f1e41c9a69912dbfca885fa5de4 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Tue, 23 Feb 2021 19:30:54 +0100 Subject: Test output fix --- ui/single/local-cfg-task-local-err.stderr | 8 ++++---- ui/single/locals-cfg.stderr | 4 ++-- ui/single/resources-cfg.stderr | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'ui/single') diff --git a/ui/single/local-cfg-task-local-err.stderr b/ui/single/local-cfg-task-local-err.stderr index 9a84ead..73dfaeb 100644 --- a/ui/single/local-cfg-task-local-err.stderr +++ b/ui/single/local-cfg-task-local-err.stderr @@ -5,15 +5,15 @@ error: task local resource "l2" is used by multiple tasks | ^^ error: task local resource "l2" is used by task "uart0" with priority 1 - --> $DIR/local-cfg-task-local-err.rs:51:39 + --> $DIR/local-cfg-task-local-err.rs:54:39 | -51 | #[cfg(feature = "feature_l2")]l2, +54 | #[cfg(feature = "feature_l2")]l2, | ^^ error: task local resource "l2" is used by task "uart1" with priority 1 - --> $DIR/local-cfg-task-local-err.rs:60:44 + --> $DIR/local-cfg-task-local-err.rs:63:44 | -60 | #[cfg(not(feature = "feature_l2"))]l2 +63 | #[cfg(not(feature = "feature_l2"))]l2 | ^^ warning: unused import: `cortex_m_semihosting::debug` diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr index 47992b3..200cea2 100644 --- a/ui/single/locals-cfg.stderr +++ b/ui/single/locals-cfg.stderr @@ -31,5 +31,5 @@ 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-e12de7683a34c500.rlib - = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-f6dc7d4a3dd7a21d.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-6f77337c1826707d.rlib + = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta diff --git a/ui/single/resources-cfg.stderr b/ui/single/resources-cfg.stderr index 39f2c1a..e367c51 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-e12de7683a34c500.rlib - = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-f6dc7d4a3dd7a21d.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-6f77337c1826707d.rlib + = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta error[E0609]: no field `o1` on type `initResources<'_>` --> $DIR/resources-cfg.rs:47:21 -- cgit v1.2.3 From d351f55e1c8e60a9bbd69b40b84a39dab5d20051 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 25 Feb 2021 19:05:39 +0100 Subject: Documentation generation fixes Test fixes --- macros/src/codegen.rs | 42 ++++++++++++---------------------- macros/src/codegen/dispatchers.rs | 24 +++++++++++-------- macros/src/codegen/locals.rs | 1 + macros/src/codegen/module.rs | 28 +++++++++++++++++++---- macros/src/codegen/post_init.rs | 3 ++- macros/src/codegen/pre_init.rs | 22 ++++++++++-------- macros/src/codegen/resources.rs | 3 ++- macros/src/codegen/resources_struct.rs | 3 ++- macros/src/codegen/software_tasks.rs | 21 +++++++++-------- macros/src/codegen/timer_queue.rs | 24 +++++++++++-------- macros/src/codegen/util.rs | 9 ++------ ui/single/resources-cfg.stderr | 30 ++++++++++++------------ 12 files changed, 114 insertions(+), 96 deletions(-) (limited to 'ui/single') diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index 7885a4a..c5d9568 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -57,6 +57,7 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { let main = util::suffixed("main"); mains.push(quote!( + #[doc(hidden)] mod rtic_ext { use super::*; #[no_mangle] @@ -88,22 +89,6 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { let user_code = &app.user_code; let name = &app.name; let device = &extra.device; - - // Get the list of all tasks - // Currently unused, might be useful - let task_list = analysis.tasks.clone(); - - let mut tasks = vec![]; - - if !task_list.is_empty() { - tasks.push(quote!( - #[allow(non_camel_case_types)] - pub enum Tasks { - #(#task_list),* - } - )); - } - let app_name = &app.name; let app_path = quote! {crate::#app_name}; @@ -114,25 +99,31 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { let name = &monotonic.ident; let name_str = &name.to_string(); let ty = &monotonic.ty; - let mangled_name = util::mangle_monotonic_type(&name_str); let ident = util::monotonic_ident(&name_str); + let ident = util::mark_internal_ident(&ident); let panic_str = &format!( "Use of monotonic '{}' before it was passed to the runtime", name_str ); + let doc = &format!( + "This module holds the static implementation for `{}::now()`", + name_str + ); + let user_imports = &app.user_imports; quote! { pub use rtic::Monotonic as _; - #[doc(hidden)] - pub type #mangled_name = #ty; - - /// This module holds the static implementation for `#name::now()` + #[doc = #doc] #[allow(non_snake_case)] pub mod #name { - /// Access the global `Monotonic` implementation, not that this will panic - /// before the this `Monotonic` has been passed to the RTIC runtime. - pub fn now() -> rtic::time::Instant<#app_path::#mangled_name> { + #( + #[allow(unused_imports)] + #user_imports + )* + + /// Read the current time from this monotonic + pub fn now() -> rtic::time::Instant<#ty> { rtic::export::interrupt::free(|_| { use rtic::Monotonic as _; use rtic::time::Clock as _; @@ -182,9 +173,6 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { #(#root_software_tasks)* - /// Unused - #(#tasks)* - /// app module #(#mod_app)* diff --git a/macros/src/codegen/dispatchers.rs b/macros/src/codegen/dispatchers.rs index d3adee0..dc33b1a 100644 --- a/macros/src/codegen/dispatchers.rs +++ b/macros/src/codegen/dispatchers.rs @@ -26,15 +26,16 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec>(); - let doc = format!( - "Software tasks to be dispatched at priority level {}", - level, - ); + // let doc = format!( + // "Software tasks to be dispatched at priority level {}", + // level, + // ); let t = util::spawn_t_ident(level); items.push(quote!( #[allow(non_camel_case_types)] #[derive(Clone, Copy)] - #[doc = #doc] + // #[doc = #doc] + #[doc(hidden)] pub enum #t { #(#variants,)* } @@ -42,6 +43,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec), @@ -51,12 +53,12 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec Vec Result<(), #ty> { let input = #tupled; @@ -226,13 +231,16 @@ pub fn codegen( // Schedule caller for (_, monotonic) in &app.monotonics { let instants = util::monotonic_instants_ident(name, &monotonic.ident); + let instants = util::mark_internal_ident(&instants); let monotonic_name = monotonic.ident.to_string(); let tq = util::tq_ident(&monotonic.ident.to_string()); + let tq = util::mark_internal_ident(&tq); let t = util::schedule_t_ident(); let m = &monotonic.ident; - let m_mangled = util::mangle_monotonic_type(&monotonic_name); + let mono_type = &monotonic.ty; let m_ident = util::monotonic_ident(&monotonic_name); + let m_ident = util::mark_internal_ident(&m_ident); let m_isr = &monotonic.args.binds; let enum_ = util::interrupt_ident(); @@ -255,15 +263,24 @@ pub fn codegen( ) }; + let user_imports = &app.user_imports; + items.push(quote!( + /// Holds methods related to this monotonic pub mod #m { + #( + #[allow(unused_imports)] + #user_imports + )* + #(#cfgs)* + /// Spawns the task after a set duration relative to the current time pub fn spawn_after( duration: D #(,#args)* ) -> Result<(), #ty> where D: rtic::time::duration::Duration + rtic::time::fixed_point::FixedPoint, - D::T: Into<<#app_path::#m_mangled as rtic::time::Clock>::T>, + D::T: Into<<#app_path::#mono_type as rtic::time::Clock>::T>, { let instant = if rtic::export::interrupt::free(|_| unsafe { #app_path::#m_ident.is_none() }) { @@ -276,8 +293,9 @@ pub fn codegen( } #(#cfgs)* + /// Spawns the task at a fixed time instant pub fn spawn_at( - instant: rtic::time::Instant<#app_path::#m_mangled> + instant: rtic::time::Instant<#app_path::#mono_type> #(,#args)* ) -> Result<(), #ty> { unsafe { diff --git a/macros/src/codegen/post_init.rs b/macros/src/codegen/post_init.rs index 8ebcb12..96c5df8 100644 --- a/macros/src/codegen/post_init.rs +++ b/macros/src/codegen/post_init.rs @@ -13,7 +13,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec { if !analysis.late_resources.is_empty() { // BTreeSet wrapped in a vector for name in analysis.late_resources.first().unwrap() { - let mangled_name = util::mangle_ident(&name); + let mangled_name = util::mark_internal_ident(&name); // If it's live let cfgs = app.late_resources[name].cfgs.clone(); if analysis.locations.get(name).is_some() { @@ -35,6 +35,7 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec { // Store the monotonic let name = util::monotonic_ident(&monotonic.to_string()); + let name = util::mark_internal_ident(&name); stmts.push(quote!(#name = Some(monotonics.#idx);)); } diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index fbfff3b..d510544 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -17,6 +17,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec Vec Vec::DISABLE_INTERRUPT_ON_EMPTY_QUEUE { core::mem::transmute::<_, cortex_m::peripheral::SYST>(()) .enable_interrupt(); } @@ -107,13 +109,13 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec::DISABLE_INTERRUPT_ON_EMPTY_QUEUE { + rtic::export::NVIC::unmask(#app_path::#rt_err::#interrupt::#binds); } )); } diff --git a/macros/src/codegen/resources.rs b/macros/src/codegen/resources.rs index 76871e5..fa52b86 100644 --- a/macros/src/codegen/resources.rs +++ b/macros/src/codegen/resources.rs @@ -21,7 +21,7 @@ pub fn codegen( for (name, res, expr, _) in app.resources(analysis) { let cfgs = &res.cfgs; let ty = &res.ty; - let mangled_name = util::mangle_ident(&name); + let mangled_name = util::mark_internal_ident(&name); { let section = if expr.is_none() { @@ -42,6 +42,7 @@ pub fn codegen( let attrs = &res.attrs; mod_app.push(quote!( #[allow(non_upper_case_globals)] + #[doc(hidden)] #(#attrs)* #(#cfgs)* #section diff --git a/macros/src/codegen/resources_struct.rs b/macros/src/codegen/resources_struct.rs index bffe943..8ed8a29 100644 --- a/macros/src/codegen/resources_struct.rs +++ b/macros/src/codegen/resources_struct.rs @@ -31,7 +31,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, None }; let ty = &res.ty; - let mangled_name = util::mangle_ident(&name); + let mangled_name = util::mark_internal_ident(&name); // let ownership = &analysis.ownerships[name]; let r_prop = &res.properties; @@ -112,6 +112,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, let doc = format!("Resources `{}` has access to", ctxt.ident(app)); let ident = util::resources_ident(ctxt, app); + let ident = util::mark_internal_ident(&ident); let item = quote!( #[allow(non_snake_case)] #[doc = #doc] diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index a760b06..a39fe4c 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -37,6 +37,7 @@ pub fn codegen( // Create free queues and inputs / instants buffers let fq = util::fq_ident(name); + let fq = util::mark_internal_ident(&fq); let (fq_ty, fq_expr, mk_uninit): (_, _, Box Option<_>>) = { ( @@ -48,8 +49,9 @@ pub fn codegen( ) }; mod_app.push(quote!( - /// Queue version of a free-list that keeps track of empty slots in - /// the following buffers + // /// Queue version of a free-list that keeps track of empty slots in + // /// the following buffers + #[doc(hidden)] static mut #fq: #fq_ty = #fq_expr; )); @@ -57,28 +59,29 @@ pub fn codegen( .map(|_| quote!(core::mem::MaybeUninit::uninit())) .collect::>(); - let app_name = &app.name; - let app_path = quote! {crate::#app_name}; - for (_, monotonic) in &app.monotonics { let instants = util::monotonic_instants_ident(name, &monotonic.ident); - let m = util::mangle_monotonic_type(&monotonic.ident.to_string()); + let instants = util::mark_internal_ident(&instants); + let mono_type = &monotonic.ty; let uninit = mk_uninit(); mod_app.push(quote!( #uninit - /// Buffer that holds the instants associated to the inputs of a task + // /// Buffer that holds the instants associated to the inputs of a task + #[doc(hidden)] static mut #instants: - [core::mem::MaybeUninit>; #cap_lit] = + [core::mem::MaybeUninit>; #cap_lit] = [#(#elems,)*]; )); } let uninit = mk_uninit(); let inputs_ident = util::inputs_ident(name); + let inputs_ident = util::mark_internal_ident(&inputs_ident); mod_app.push(quote!( #uninit - /// Buffer that holds the inputs of a task + // /// Buffer that holds the inputs of a task + #[doc(hidden)] static mut #inputs_ident: [core::mem::MaybeUninit<#input_ty>; #cap_lit] = [#(#elems,)*]; )); diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index ea2fee6..82d0ac9 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -26,9 +26,10 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec>(); - let doc = "Tasks that can be scheduled".to_string(); + // let doc = "Tasks that can be scheduled".to_string(); items.push(quote!( - #[doc = #doc] + // #[doc = #doc] + #[doc(hidden)] #[allow(non_camel_case_types)] #[derive(Clone, Copy)] enum #t { @@ -41,25 +42,27 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec); + let tq_ty = quote!(rtic::export::TimerQueue<#mono_type, #t, #n>); items.push(quote!( - #[doc = #doc] + #[doc(hidden)] static mut #tq: #tq_ty = rtic::export::TimerQueue( rtic::export::BinaryHeap( rtic::export::iBinaryHeap::new() @@ -68,12 +71,12 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec); + let mono = util::mark_internal_ident(&mono); + // let doc = &format!("Storage for {}", monotonic_name); items.push(quote!( - #[doc = #doc] - static mut #mono: #mono_ty = None; + #[doc(hidden)] + static mut #mono: Option<#mono_type> = None; )); } @@ -89,6 +92,7 @@ pub fn codegen(app: &App, analysis: &Analysis, _extra: &Extra) -> Vec bool { ) } -/// Mangle an ident -pub fn mangle_ident(ident: &Ident) -> Ident { +/// Mark an ident as internal +pub fn mark_internal_ident(ident: &Ident) -> Ident { Ident::new( &format!("__rtic_internal_{}", ident.to_string()), Span::call_site(), @@ -244,11 +244,6 @@ pub fn monotonic_ident(name: &str) -> Ident { Ident::new(&format!("MONOTONIC_STORAGE_{}", name), Span::call_site()) } -/// Generates an identifier for monotonic timer storage -pub fn mangle_monotonic_type(name: &str) -> Ident { - Ident::new(&format!("MonotonicMangled{}", name), Span::call_site()) -} - /// The name to get better RT flag errors pub fn rt_err_ident() -> Ident { Ident::new( diff --git a/ui/single/resources-cfg.stderr b/ui/single/resources-cfg.stderr index e367c51..3bbbd2d 100644 --- a/ui/single/resources-cfg.stderr +++ b/ui/single/resources-cfg.stderr @@ -4,7 +4,7 @@ error: duplicate lang item in crate `panic_halt` (which `$CRATE` depends on): `p = 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-6f77337c1826707d.rlib = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta -error[E0609]: no field `o1` on type `initResources<'_>` +error[E0609]: no field `o1` on type `__rtic_internal_initResources<'_>` --> $DIR/resources-cfg.rs:47:21 | 47 | c.resources.o1; @@ -12,7 +12,7 @@ error[E0609]: no field `o1` on type `initResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o4` on type `initResources<'_>` +error[E0609]: no field `o4` on type `__rtic_internal_initResources<'_>` --> $DIR/resources-cfg.rs:48:21 | 48 | c.resources.o4; @@ -20,7 +20,7 @@ error[E0609]: no field `o4` on type `initResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o5` on type `initResources<'_>` +error[E0609]: no field `o5` on type `__rtic_internal_initResources<'_>` --> $DIR/resources-cfg.rs:49:21 | 49 | c.resources.o5; @@ -28,7 +28,7 @@ error[E0609]: no field `o5` on type `initResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o6` on type `initResources<'_>` +error[E0609]: no field `o6` on type `__rtic_internal_initResources<'_>` --> $DIR/resources-cfg.rs:50:21 | 50 | c.resources.o6; @@ -36,7 +36,7 @@ error[E0609]: no field `o6` on type `initResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s3` on type `initResources<'_>` +error[E0609]: no field `s3` on type `__rtic_internal_initResources<'_>` --> $DIR/resources-cfg.rs:51:21 | 51 | c.resources.s3; @@ -44,7 +44,7 @@ error[E0609]: no field `s3` on type `initResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o2` on type `idleResources<'_>` +error[E0609]: no field `o2` on type `__rtic_internal_idleResources<'_>` --> $DIR/resources-cfg.rs:58:21 | 58 | c.resources.o2; @@ -52,7 +52,7 @@ error[E0609]: no field `o2` on type `idleResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o4` on type `idleResources<'_>` +error[E0609]: no field `o4` on type `__rtic_internal_idleResources<'_>` --> $DIR/resources-cfg.rs:59:21 | 59 | c.resources.o4; @@ -60,7 +60,7 @@ error[E0609]: no field `o4` on type `idleResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s1` on type `idleResources<'_>` +error[E0609]: no field `s1` on type `__rtic_internal_idleResources<'_>` --> $DIR/resources-cfg.rs:60:21 | 60 | c.resources.s1; @@ -68,7 +68,7 @@ error[E0609]: no field `s1` on type `idleResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s3` on type `idleResources<'_>` +error[E0609]: no field `s3` on type `__rtic_internal_idleResources<'_>` --> $DIR/resources-cfg.rs:61:21 | 61 | c.resources.s3; @@ -76,7 +76,7 @@ error[E0609]: no field `s3` on type `idleResources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o3` on type `uart0Resources<'_>` +error[E0609]: no field `o3` on type `__rtic_internal_uart0Resources<'_>` --> $DIR/resources-cfg.rs:68:21 | 68 | c.resources.o3; @@ -84,7 +84,7 @@ error[E0609]: no field `o3` on type `uart0Resources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s1` on type `uart0Resources<'_>` +error[E0609]: no field `s1` on type `__rtic_internal_uart0Resources<'_>` --> $DIR/resources-cfg.rs:69:21 | 69 | c.resources.s1; @@ -92,7 +92,7 @@ error[E0609]: no field `s1` on type `uart0Resources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s2` on type `uart0Resources<'_>` +error[E0609]: no field `s2` on type `__rtic_internal_uart0Resources<'_>` --> $DIR/resources-cfg.rs:70:21 | 70 | c.resources.s2; @@ -100,7 +100,7 @@ error[E0609]: no field `s2` on type `uart0Resources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s3` on type `uart0Resources<'_>` +error[E0609]: no field `s3` on type `__rtic_internal_uart0Resources<'_>` --> $DIR/resources-cfg.rs:71:21 | 71 | c.resources.s3; @@ -108,7 +108,7 @@ error[E0609]: no field `s3` on type `uart0Resources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `s2` on type `uart1Resources<'_>` +error[E0609]: no field `s2` on type `__rtic_internal_uart1Resources<'_>` --> $DIR/resources-cfg.rs:76:21 | 76 | c.resources.s2; @@ -116,7 +116,7 @@ error[E0609]: no field `s2` on type `uart1Resources<'_>` | = note: available fields are: `__marker__` -error[E0609]: no field `o5` on type `uart1Resources<'_>` +error[E0609]: no field `o5` on type `__rtic_internal_uart1Resources<'_>` --> $DIR/resources-cfg.rs:77:21 | 77 | c.resources.o5; -- cgit v1.2.3 From a5795a8f45f73099d88817fc8eb6c265689b862e Mon Sep 17 00:00:00 2001 From: Henrik Tjäder Date: Wed, 3 Mar 2021 08:55:19 +0100 Subject: Remove keyword single for all tests --- tests/single.rs | 7 -- tests/tests.rs | 7 ++ ui/exception-invalid.rs | 7 ++ ui/exception-invalid.stderr | 5 ++ ui/extern-interrupt-not-enough.rs | 7 ++ ui/extern-interrupt-not-enough.stderr | 5 ++ ui/extern-interrupt-used.rs | 7 ++ ui/extern-interrupt-used.stderr | 5 ++ ui/local-cfg-task-local-err.rs | 69 +++++++++++++++ ui/local-cfg-task-local-err.stderr | 37 ++++++++ ui/local-err.rs | 83 ++++++++++++++++++ ui/local-err.stderr | 60 +++++++++++++ ui/locals-cfg.rs | 49 +++++++++++ ui/locals-cfg.stderr | 35 ++++++++ ui/resources-cfg.rs | 79 +++++++++++++++++ ui/resources-cfg.stderr | 125 +++++++++++++++++++++++++++ ui/single/exception-invalid.rs | 7 -- ui/single/exception-invalid.stderr | 5 -- ui/single/extern-interrupt-not-enough.rs | 7 -- ui/single/extern-interrupt-not-enough.stderr | 5 -- ui/single/extern-interrupt-used.rs | 7 -- ui/single/extern-interrupt-used.stderr | 5 -- ui/single/local-cfg-task-local-err.rs | 69 --------------- ui/single/local-cfg-task-local-err.stderr | 37 -------- ui/single/local-err.rs | 83 ------------------ ui/single/local-err.stderr | 60 ------------- ui/single/locals-cfg.rs | 49 ----------- ui/single/locals-cfg.stderr | 35 -------- ui/single/resources-cfg.rs | 79 ----------------- ui/single/resources-cfg.stderr | 125 --------------------------- ui/single/task-priority-too-high.rs | 38 -------- ui/single/task-priority-too-high.stderr | 7 -- ui/task-priority-too-high.rs | 38 ++++++++ ui/task-priority-too-high.stderr | 7 ++ 34 files changed, 625 insertions(+), 625 deletions(-) delete mode 100644 tests/single.rs create mode 100644 tests/tests.rs create mode 100644 ui/exception-invalid.rs create mode 100644 ui/exception-invalid.stderr create mode 100644 ui/extern-interrupt-not-enough.rs create mode 100644 ui/extern-interrupt-not-enough.stderr create mode 100644 ui/extern-interrupt-used.rs create mode 100644 ui/extern-interrupt-used.stderr create mode 100644 ui/local-cfg-task-local-err.rs create mode 100644 ui/local-cfg-task-local-err.stderr create mode 100644 ui/local-err.rs create mode 100644 ui/local-err.stderr create mode 100644 ui/locals-cfg.rs create mode 100644 ui/locals-cfg.stderr create mode 100644 ui/resources-cfg.rs create mode 100644 ui/resources-cfg.stderr delete mode 100644 ui/single/exception-invalid.rs delete mode 100644 ui/single/exception-invalid.stderr delete mode 100644 ui/single/extern-interrupt-not-enough.rs delete mode 100644 ui/single/extern-interrupt-not-enough.stderr delete mode 100644 ui/single/extern-interrupt-used.rs delete mode 100644 ui/single/extern-interrupt-used.stderr delete mode 100644 ui/single/local-cfg-task-local-err.rs delete mode 100644 ui/single/local-cfg-task-local-err.stderr delete mode 100644 ui/single/local-err.rs delete mode 100644 ui/single/local-err.stderr delete mode 100644 ui/single/locals-cfg.rs delete mode 100644 ui/single/locals-cfg.stderr delete mode 100644 ui/single/resources-cfg.rs delete mode 100644 ui/single/resources-cfg.stderr delete mode 100644 ui/single/task-priority-too-high.rs delete mode 100644 ui/single/task-priority-too-high.stderr create mode 100644 ui/task-priority-too-high.rs create mode 100644 ui/task-priority-too-high.stderr (limited to 'ui/single') diff --git a/tests/single.rs b/tests/single.rs deleted file mode 100644 index b5d480c..0000000 --- a/tests/single.rs +++ /dev/null @@ -1,7 +0,0 @@ -use trybuild::TestCases; - -#[test] -fn ui() { - let t = TestCases::new(); - t.compile_fail("ui/single/*.rs"); -} diff --git a/tests/tests.rs b/tests/tests.rs new file mode 100644 index 0000000..b5d480c --- /dev/null +++ b/tests/tests.rs @@ -0,0 +1,7 @@ +use trybuild::TestCases; + +#[test] +fn ui() { + let t = TestCases::new(); + t.compile_fail("ui/single/*.rs"); +} diff --git a/ui/exception-invalid.rs b/ui/exception-invalid.rs new file mode 100644 index 0000000..04d9bc7 --- /dev/null +++ b/ui/exception-invalid.rs @@ -0,0 +1,7 @@ +#![no_main] + +#[rtic::app(device = lm3s6965)] +mod app { + #[task(binds = NonMaskableInt)] + fn nmi(_: nmi::Context) {} +} diff --git a/ui/exception-invalid.stderr b/ui/exception-invalid.stderr new file mode 100644 index 0000000..9021376 --- /dev/null +++ b/ui/exception-invalid.stderr @@ -0,0 +1,5 @@ +error: only exceptions with configurable priority can be used as hardware tasks + --> $DIR/exception-invalid.rs:6:8 + | +6 | fn nmi(_: nmi::Context) {} + | ^^^ diff --git a/ui/extern-interrupt-not-enough.rs b/ui/extern-interrupt-not-enough.rs new file mode 100644 index 0000000..f262403 --- /dev/null +++ b/ui/extern-interrupt-not-enough.rs @@ -0,0 +1,7 @@ +#![no_main] + +#[rtic::app(device = lm3s6965)] +mod app { + #[task] + fn a(_: a::Context) {} +} diff --git a/ui/extern-interrupt-not-enough.stderr b/ui/extern-interrupt-not-enough.stderr new file mode 100644 index 0000000..14f8fe9 --- /dev/null +++ b/ui/extern-interrupt-not-enough.stderr @@ -0,0 +1,5 @@ +error: not enough interrupts to dispatch all software tasks (need: 1; given: 0) + --> $DIR/extern-interrupt-not-enough.rs:6:8 + | +6 | fn a(_: a::Context) {} + | ^ diff --git a/ui/extern-interrupt-used.rs b/ui/extern-interrupt-used.rs new file mode 100644 index 0000000..240e736 --- /dev/null +++ b/ui/extern-interrupt-used.rs @@ -0,0 +1,7 @@ +#![no_main] + +#[rtic::app(device = lm3s6965, dispatchers = [UART0])] +mod app { + #[task(binds = UART0)] + fn a(_: a::Context) {} +} diff --git a/ui/extern-interrupt-used.stderr b/ui/extern-interrupt-used.stderr new file mode 100644 index 0000000..b4d8d16 --- /dev/null +++ b/ui/extern-interrupt-used.stderr @@ -0,0 +1,5 @@ +error: dispatcher interrupts can't be used as hardware tasks + --> $DIR/extern-interrupt-used.rs:5:20 + | +5 | #[task(binds = UART0)] + | ^^^^^ diff --git a/ui/local-cfg-task-local-err.rs b/ui/local-cfg-task-local-err.rs new file mode 100644 index 0000000..d4752ed --- /dev/null +++ b/ui/local-cfg-task-local-err.rs @@ -0,0 +1,69 @@ +//! examples/local-cfg-task-local.rs + +#![deny(unsafe_code)] +//#![deny(warnings)] +#![no_main] +#![no_std] + +use cortex_m_semihosting::debug; +use cortex_m_semihosting::hprintln; +use lm3s6965::Interrupt; +use panic_semihosting as _; + +#[rtic::app(device = lm3s6965)] +mod app { + #[resources] + struct Resources { + // A local (move), early resource + #[cfg(feature = "feature_l1")] + #[task_local] + #[init(1)] + l1: u32, + + // A local (move), late resource + #[task_local] + l2: u32, + } + + #[init] + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); + ( + init::LateResources { + #[cfg(feature = "feature_l2")] + l2: 2, + #[cfg(not(feature = "feature_l2"))] + l2: 5, + }, + init::Monotonics(), + ) + } + + // l1 ok (task_local) + #[idle(resources =[#[cfg(feature = "feature_l1")]l1])] + fn idle(_cx: idle::Context) -> ! { + #[cfg(feature = "feature_l1")] + hprintln!("IDLE:l1 = {}", _cx.resources.l1).unwrap(); + debug::exit(debug::EXIT_SUCCESS); + loop {} + } + + // l2 ok (task_local) + #[task(priority = 1, binds = UART0, resources = [ + #[cfg(feature = "feature_l2")]l2, + ])] + fn uart0(_cx: uart0::Context) { + #[cfg(feature = "feature_l2")] + hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap(); + } + + // l2 error, conflicting with uart0 for l2 (task_local) + #[task(priority = 1, binds = UART1, resources = [ + #[cfg(not(feature = "feature_l2"))]l2 + ])] + fn uart1(_cx: uart1::Context) { + #[cfg(not(feature = "feature_l2"))] + hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap(); + } +} diff --git a/ui/local-cfg-task-local-err.stderr b/ui/local-cfg-task-local-err.stderr new file mode 100644 index 0000000..73dfaeb --- /dev/null +++ b/ui/local-cfg-task-local-err.stderr @@ -0,0 +1,37 @@ +error: task local resource "l2" is used by multiple tasks + --> $DIR/local-cfg-task-local-err.rs:25:9 + | +25 | l2: u32, + | ^^ + +error: task local resource "l2" is used by task "uart0" with priority 1 + --> $DIR/local-cfg-task-local-err.rs:54:39 + | +54 | #[cfg(feature = "feature_l2")]l2, + | ^^ + +error: task local resource "l2" is used by task "uart1" with priority 1 + --> $DIR/local-cfg-task-local-err.rs:63:44 + | +63 | #[cfg(not(feature = "feature_l2"))]l2 + | ^^ + +warning: unused import: `cortex_m_semihosting::debug` + --> $DIR/local-cfg-task-local-err.rs:8:5 + | +8 | use cortex_m_semihosting::debug; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: `#[warn(unused_imports)]` on by default + +warning: unused import: `cortex_m_semihosting::hprintln` + --> $DIR/local-cfg-task-local-err.rs:9:5 + | +9 | use cortex_m_semihosting::hprintln; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: unused import: `lm3s6965::Interrupt` + --> $DIR/local-cfg-task-local-err.rs:10:5 + | +10 | use lm3s6965::Interrupt; + | ^^^^^^^^^^^^^^^^^^^ diff --git a/ui/local-err.rs b/ui/local-err.rs new file mode 100644 index 0000000..7ebfc06 --- /dev/null +++ b/ui/local-err.rs @@ -0,0 +1,83 @@ +//! examples/local_err.rs + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +// errors here, since we cannot bail compilation or generate stubs +// run cargo expand, then you see the root of the problem... +use cortex_m_semihosting::{debug, hprintln}; +use lm3s6965::Interrupt; +use panic_semihosting as _; + +#[rtic::app(device = lm3s6965)] +mod app { + #[resources] + struct Resources { + // An early resource + #[init(0)] + shared: u32, + + // A local (move), early resource + #[task_local] + #[init(1)] + l1: u32, + + // An exclusive, early resource + #[lock_free] + #[init(1)] + e1: u32, + + // A local (move), late resource + #[task_local] + l2: u32, + + // An exclusive, late resource + #[lock_free] + e2: u32, + } + + #[init] + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + rtic::pend(Interrupt::UART0); + rtic::pend(Interrupt::UART1); + (init::LateResources { e2: 2, l2: 2 }, init::Monotonics()) + } + + // `shared` cannot be accessed from this context + // l1 ok + // l2 rejeceted (not task_local) + // e2 ok + #[idle(resources =[l1, l2, e2])] + fn idle(cx: idle::Context) -> ! { + hprintln!("IDLE:l1 = {}", cx.resources.l1).unwrap(); + hprintln!("IDLE:e2 = {}", cx.resources.e2).unwrap(); + debug::exit(debug::EXIT_SUCCESS); + loop {} + } + + // `shared` can be accessed from this context + // l2 rejected (not task_local) + // e1 rejected (not lock_free) + #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] + fn uart0(cx: uart0::Context) { + let shared: &mut u32 = cx.resources.shared; + *shared += 1; + *cx.resources.e1 += 10; + hprintln!("UART0: shared = {}", shared).unwrap(); + hprintln!("UART0:l2 = {}", cx.resources.l2).unwrap(); + hprintln!("UART0:e1 = {}", cx.resources.e1).unwrap(); + } + + // l2 rejected (not task_local) + #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] + fn uart1(cx: uart1::Context) { + let shared: &mut u32 = cx.resources.shared; + *shared += 1; + + hprintln!("UART1: shared = {}", shared).unwrap(); + hprintln!("UART1:l2 = {}", cx.resources.l2).unwrap(); + hprintln!("UART1:e1 = {}", cx.resources.e1).unwrap(); + } +} diff --git a/ui/local-err.stderr b/ui/local-err.stderr new file mode 100644 index 0000000..88369d8 --- /dev/null +++ b/ui/local-err.stderr @@ -0,0 +1,60 @@ +error: task local resource "l2" is used by multiple tasks + --> $DIR/local-err.rs:34:9 + | +34 | l2: u32, + | ^^ + +error: task local resource "l2" is used by task "idle" with priority 0 + --> $DIR/local-err.rs:52:28 + | +52 | #[idle(resources =[l1, l2, e2])] + | ^^ + +error: task local resource "l2" is used by task "uart0" with priority 1 + --> $DIR/local-err.rs:63:62 + | +63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] + | ^^ + +error: task local resource "l2" is used by task "uart1" with priority 2 + --> $DIR/local-err.rs:74:62 + | +74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] + | ^^ + +error: Lock free resource "e1" is used by tasks at different priorities + --> $DIR/local-err.rs:30:9 + | +30 | e1: u32, + | ^^ + +error: Resource "e1" is declared lock free but used by tasks at different priorities + --> $DIR/local-err.rs:63:66 + | +63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] + | ^^ + +error: Resource "e1" is declared lock free but used by tasks at different priorities + --> $DIR/local-err.rs:74:66 + | +74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] + | ^^ + +error: unused imports: `debug`, `hprintln` + --> $DIR/local-err.rs:10:28 + | +10 | use cortex_m_semihosting::{debug, hprintln}; + | ^^^^^ ^^^^^^^^ + | +note: the lint level is defined here + --> $DIR/local-err.rs:4:9 + | +4 | #![deny(warnings)] + | ^^^^^^^^ + = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]` + +error: unused import: `lm3s6965::Interrupt` + --> $DIR/local-err.rs:11:5 + | +11 | use lm3s6965::Interrupt; + | ^^^^^^^^^^^^^^^^^^^ diff --git a/ui/locals-cfg.rs b/ui/locals-cfg.rs new file mode 100644 index 0000000..72e2aca --- /dev/null +++ b/ui/locals-cfg.rs @@ -0,0 +1,49 @@ +#![no_main] +use panic_halt as _; + +#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] +mod app { + #[init] + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + #[cfg(never)] + static mut FOO: u32 = 0; + + FOO; + + (init::LateResources {}, init::Monotonics()) + } + + #[idle] + fn idle(_: idle::Context) -> ! { + #[cfg(never)] + static mut FOO: u32 = 0; + + FOO; + + loop {} + } + + #[task(binds = SVCall)] + fn svcall(_: svcall::Context) { + #[cfg(never)] + static mut FOO: u32 = 0; + + FOO; + } + + #[task(binds = UART0)] + fn uart0(_: uart0::Context) { + #[cfg(never)] + static mut FOO: u32 = 0; + + FOO; + } + + #[task] + fn foo(_: foo::Context) { + #[cfg(never)] + static mut FOO: u32 = 0; + + FOO; + } +} diff --git a/ui/locals-cfg.stderr b/ui/locals-cfg.stderr new file mode 100644 index 0000000..200cea2 --- /dev/null +++ b/ui/locals-cfg.stderr @@ -0,0 +1,35 @@ +error[E0425]: cannot find value `FOO` in this scope + --> $DIR/locals-cfg.rs:11:9 + | +11 | FOO; + | ^^^ not found in this scope + +error[E0425]: cannot find value `FOO` in this scope + --> $DIR/locals-cfg.rs:21:9 + | +21 | FOO; + | ^^^ not found in this scope + +error[E0425]: cannot find value `FOO` in this scope + --> $DIR/locals-cfg.rs:31:9 + | +31 | FOO; + | ^^^ not found in this scope + +error[E0425]: cannot find value `FOO` in this scope + --> $DIR/locals-cfg.rs:39:9 + | +39 | FOO; + | ^^^ not found in this scope + +error[E0425]: cannot find value `FOO` in this scope + --> $DIR/locals-cfg.rs:47:9 + | +47 | FOO; + | ^^^ not found 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-6f77337c1826707d.rlib + = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta diff --git a/ui/resources-cfg.rs b/ui/resources-cfg.rs new file mode 100644 index 0000000..c11d2ba --- /dev/null +++ b/ui/resources-cfg.rs @@ -0,0 +1,79 @@ +#![no_main] +use panic_halt as _; + +#[rtic::app(device = lm3s6965)] +mod app { + #[resources] + struct Resources { + #[cfg(never)] + #[init(0)] + o1: u32, // init + + #[cfg(never)] + #[init(0)] + o2: u32, // idle + + #[cfg(never)] + #[init(0)] + o3: u32, // EXTI0 + + #[cfg(never)] + #[init(0)] + o4: u32, // idle + + #[cfg(never)] + #[init(0)] + o5: u32, // EXTI1 + + #[cfg(never)] + #[init(0)] + o6: u32, // init + + #[cfg(never)] + #[init(0)] + s1: u32, // idle & EXTI0 + + #[cfg(never)] + #[init(0)] + s2: u32, // EXTI0 & EXTI1 + + #[cfg(never)] + #[init(0)] + s3: u32, + } + + #[init(resources = [o1, o4, o5, o6, s3])] + fn init(c: init::Context) -> (init::LateResources, init::Monotonics) { + c.resources.o1; + c.resources.o4; + c.resources.o5; + c.resources.o6; + c.resources.s3; + + (init::LateResources {}, init::Monotonics()) + } + + #[idle(resources = [o2, &o4, s1, &s3])] + fn idle(c: idle::Context) -> ! { + c.resources.o2; + c.resources.o4; + c.resources.s1; + c.resources.s3; + + loop {} + } + + #[task(binds = UART0, resources = [o3, s1, s2, &s3])] + fn uart0(c: uart0::Context) { + c.resources.o3; + c.resources.s1; + c.resources.s2; + c.resources.s3; + } + + #[task(binds = UART1, resources = [s2, &o5])] + fn uart1(c: uart1::Context) { + c.resources.s2; + c.resources.o5; + } +} diff --git a/ui/resources-cfg.stderr b/ui/resources-cfg.stderr new file mode 100644 index 0000000..3bbbd2d --- /dev/null +++ b/ui/resources-cfg.stderr @@ -0,0 +1,125 @@ +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-6f77337c1826707d.rlib + = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta + +error[E0609]: no field `o1` on type `__rtic_internal_initResources<'_>` + --> $DIR/resources-cfg.rs:47:21 + | +47 | c.resources.o1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o4` on type `__rtic_internal_initResources<'_>` + --> $DIR/resources-cfg.rs:48:21 + | +48 | c.resources.o4; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o5` on type `__rtic_internal_initResources<'_>` + --> $DIR/resources-cfg.rs:49:21 + | +49 | c.resources.o5; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o6` on type `__rtic_internal_initResources<'_>` + --> $DIR/resources-cfg.rs:50:21 + | +50 | c.resources.o6; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `__rtic_internal_initResources<'_>` + --> $DIR/resources-cfg.rs:51:21 + | +51 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o2` on type `__rtic_internal_idleResources<'_>` + --> $DIR/resources-cfg.rs:58:21 + | +58 | c.resources.o2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o4` on type `__rtic_internal_idleResources<'_>` + --> $DIR/resources-cfg.rs:59:21 + | +59 | c.resources.o4; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s1` on type `__rtic_internal_idleResources<'_>` + --> $DIR/resources-cfg.rs:60:21 + | +60 | c.resources.s1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `__rtic_internal_idleResources<'_>` + --> $DIR/resources-cfg.rs:61:21 + | +61 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o3` on type `__rtic_internal_uart0Resources<'_>` + --> $DIR/resources-cfg.rs:68:21 + | +68 | c.resources.o3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s1` on type `__rtic_internal_uart0Resources<'_>` + --> $DIR/resources-cfg.rs:69:21 + | +69 | c.resources.s1; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s2` on type `__rtic_internal_uart0Resources<'_>` + --> $DIR/resources-cfg.rs:70:21 + | +70 | c.resources.s2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s3` on type `__rtic_internal_uart0Resources<'_>` + --> $DIR/resources-cfg.rs:71:21 + | +71 | c.resources.s3; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `s2` on type `__rtic_internal_uart1Resources<'_>` + --> $DIR/resources-cfg.rs:76:21 + | +76 | c.resources.s2; + | ^^ unknown field + | + = note: available fields are: `__marker__` + +error[E0609]: no field `o5` on type `__rtic_internal_uart1Resources<'_>` + --> $DIR/resources-cfg.rs:77:21 + | +77 | c.resources.o5; + | ^^ unknown field + | + = note: available fields are: `__marker__` diff --git a/ui/single/exception-invalid.rs b/ui/single/exception-invalid.rs deleted file mode 100644 index 04d9bc7..0000000 --- a/ui/single/exception-invalid.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![no_main] - -#[rtic::app(device = lm3s6965)] -mod app { - #[task(binds = NonMaskableInt)] - fn nmi(_: nmi::Context) {} -} diff --git a/ui/single/exception-invalid.stderr b/ui/single/exception-invalid.stderr deleted file mode 100644 index 9021376..0000000 --- a/ui/single/exception-invalid.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: only exceptions with configurable priority can be used as hardware tasks - --> $DIR/exception-invalid.rs:6:8 - | -6 | fn nmi(_: nmi::Context) {} - | ^^^ diff --git a/ui/single/extern-interrupt-not-enough.rs b/ui/single/extern-interrupt-not-enough.rs deleted file mode 100644 index f262403..0000000 --- a/ui/single/extern-interrupt-not-enough.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![no_main] - -#[rtic::app(device = lm3s6965)] -mod app { - #[task] - fn a(_: a::Context) {} -} diff --git a/ui/single/extern-interrupt-not-enough.stderr b/ui/single/extern-interrupt-not-enough.stderr deleted file mode 100644 index 14f8fe9..0000000 --- a/ui/single/extern-interrupt-not-enough.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: not enough interrupts to dispatch all software tasks (need: 1; given: 0) - --> $DIR/extern-interrupt-not-enough.rs:6:8 - | -6 | fn a(_: a::Context) {} - | ^ diff --git a/ui/single/extern-interrupt-used.rs b/ui/single/extern-interrupt-used.rs deleted file mode 100644 index 240e736..0000000 --- a/ui/single/extern-interrupt-used.rs +++ /dev/null @@ -1,7 +0,0 @@ -#![no_main] - -#[rtic::app(device = lm3s6965, dispatchers = [UART0])] -mod app { - #[task(binds = UART0)] - fn a(_: a::Context) {} -} diff --git a/ui/single/extern-interrupt-used.stderr b/ui/single/extern-interrupt-used.stderr deleted file mode 100644 index b4d8d16..0000000 --- a/ui/single/extern-interrupt-used.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error: dispatcher interrupts can't be used as hardware tasks - --> $DIR/extern-interrupt-used.rs:5:20 - | -5 | #[task(binds = UART0)] - | ^^^^^ diff --git a/ui/single/local-cfg-task-local-err.rs b/ui/single/local-cfg-task-local-err.rs deleted file mode 100644 index d4752ed..0000000 --- a/ui/single/local-cfg-task-local-err.rs +++ /dev/null @@ -1,69 +0,0 @@ -//! examples/local-cfg-task-local.rs - -#![deny(unsafe_code)] -//#![deny(warnings)] -#![no_main] -#![no_std] - -use cortex_m_semihosting::debug; -use cortex_m_semihosting::hprintln; -use lm3s6965::Interrupt; -use panic_semihosting as _; - -#[rtic::app(device = lm3s6965)] -mod app { - #[resources] - struct Resources { - // A local (move), early resource - #[cfg(feature = "feature_l1")] - #[task_local] - #[init(1)] - l1: u32, - - // A local (move), late resource - #[task_local] - l2: u32, - } - - #[init] - fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { - rtic::pend(Interrupt::UART0); - rtic::pend(Interrupt::UART1); - ( - init::LateResources { - #[cfg(feature = "feature_l2")] - l2: 2, - #[cfg(not(feature = "feature_l2"))] - l2: 5, - }, - init::Monotonics(), - ) - } - - // l1 ok (task_local) - #[idle(resources =[#[cfg(feature = "feature_l1")]l1])] - fn idle(_cx: idle::Context) -> ! { - #[cfg(feature = "feature_l1")] - hprintln!("IDLE:l1 = {}", _cx.resources.l1).unwrap(); - debug::exit(debug::EXIT_SUCCESS); - loop {} - } - - // l2 ok (task_local) - #[task(priority = 1, binds = UART0, resources = [ - #[cfg(feature = "feature_l2")]l2, - ])] - fn uart0(_cx: uart0::Context) { - #[cfg(feature = "feature_l2")] - hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap(); - } - - // l2 error, conflicting with uart0 for l2 (task_local) - #[task(priority = 1, binds = UART1, resources = [ - #[cfg(not(feature = "feature_l2"))]l2 - ])] - fn uart1(_cx: uart1::Context) { - #[cfg(not(feature = "feature_l2"))] - hprintln!("UART0:l2 = {}", _cx.resources.l2).unwrap(); - } -} diff --git a/ui/single/local-cfg-task-local-err.stderr b/ui/single/local-cfg-task-local-err.stderr deleted file mode 100644 index 73dfaeb..0000000 --- a/ui/single/local-cfg-task-local-err.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error: task local resource "l2" is used by multiple tasks - --> $DIR/local-cfg-task-local-err.rs:25:9 - | -25 | l2: u32, - | ^^ - -error: task local resource "l2" is used by task "uart0" with priority 1 - --> $DIR/local-cfg-task-local-err.rs:54:39 - | -54 | #[cfg(feature = "feature_l2")]l2, - | ^^ - -error: task local resource "l2" is used by task "uart1" with priority 1 - --> $DIR/local-cfg-task-local-err.rs:63:44 - | -63 | #[cfg(not(feature = "feature_l2"))]l2 - | ^^ - -warning: unused import: `cortex_m_semihosting::debug` - --> $DIR/local-cfg-task-local-err.rs:8:5 - | -8 | use cortex_m_semihosting::debug; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default - -warning: unused import: `cortex_m_semihosting::hprintln` - --> $DIR/local-cfg-task-local-err.rs:9:5 - | -9 | use cortex_m_semihosting::hprintln; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `lm3s6965::Interrupt` - --> $DIR/local-cfg-task-local-err.rs:10:5 - | -10 | use lm3s6965::Interrupt; - | ^^^^^^^^^^^^^^^^^^^ diff --git a/ui/single/local-err.rs b/ui/single/local-err.rs deleted file mode 100644 index 7ebfc06..0000000 --- a/ui/single/local-err.rs +++ /dev/null @@ -1,83 +0,0 @@ -//! examples/local_err.rs - -#![deny(unsafe_code)] -#![deny(warnings)] -#![no_main] -#![no_std] - -// errors here, since we cannot bail compilation or generate stubs -// run cargo expand, then you see the root of the problem... -use cortex_m_semihosting::{debug, hprintln}; -use lm3s6965::Interrupt; -use panic_semihosting as _; - -#[rtic::app(device = lm3s6965)] -mod app { - #[resources] - struct Resources { - // An early resource - #[init(0)] - shared: u32, - - // A local (move), early resource - #[task_local] - #[init(1)] - l1: u32, - - // An exclusive, early resource - #[lock_free] - #[init(1)] - e1: u32, - - // A local (move), late resource - #[task_local] - l2: u32, - - // An exclusive, late resource - #[lock_free] - e2: u32, - } - - #[init] - fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { - rtic::pend(Interrupt::UART0); - rtic::pend(Interrupt::UART1); - (init::LateResources { e2: 2, l2: 2 }, init::Monotonics()) - } - - // `shared` cannot be accessed from this context - // l1 ok - // l2 rejeceted (not task_local) - // e2 ok - #[idle(resources =[l1, l2, e2])] - fn idle(cx: idle::Context) -> ! { - hprintln!("IDLE:l1 = {}", cx.resources.l1).unwrap(); - hprintln!("IDLE:e2 = {}", cx.resources.e2).unwrap(); - debug::exit(debug::EXIT_SUCCESS); - loop {} - } - - // `shared` can be accessed from this context - // l2 rejected (not task_local) - // e1 rejected (not lock_free) - #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] - fn uart0(cx: uart0::Context) { - let shared: &mut u32 = cx.resources.shared; - *shared += 1; - *cx.resources.e1 += 10; - hprintln!("UART0: shared = {}", shared).unwrap(); - hprintln!("UART0:l2 = {}", cx.resources.l2).unwrap(); - hprintln!("UART0:e1 = {}", cx.resources.e1).unwrap(); - } - - // l2 rejected (not task_local) - #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] - fn uart1(cx: uart1::Context) { - let shared: &mut u32 = cx.resources.shared; - *shared += 1; - - hprintln!("UART1: shared = {}", shared).unwrap(); - hprintln!("UART1:l2 = {}", cx.resources.l2).unwrap(); - hprintln!("UART1:e1 = {}", cx.resources.e1).unwrap(); - } -} diff --git a/ui/single/local-err.stderr b/ui/single/local-err.stderr deleted file mode 100644 index 88369d8..0000000 --- a/ui/single/local-err.stderr +++ /dev/null @@ -1,60 +0,0 @@ -error: task local resource "l2" is used by multiple tasks - --> $DIR/local-err.rs:34:9 - | -34 | l2: u32, - | ^^ - -error: task local resource "l2" is used by task "idle" with priority 0 - --> $DIR/local-err.rs:52:28 - | -52 | #[idle(resources =[l1, l2, e2])] - | ^^ - -error: task local resource "l2" is used by task "uart0" with priority 1 - --> $DIR/local-err.rs:63:62 - | -63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] - | ^^ - -error: task local resource "l2" is used by task "uart1" with priority 2 - --> $DIR/local-err.rs:74:62 - | -74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] - | ^^ - -error: Lock free resource "e1" is used by tasks at different priorities - --> $DIR/local-err.rs:30:9 - | -30 | e1: u32, - | ^^ - -error: Resource "e1" is declared lock free but used by tasks at different priorities - --> $DIR/local-err.rs:63:66 - | -63 | #[task(priority = 1, binds = UART0, resources = [shared, l2, e1])] - | ^^ - -error: Resource "e1" is declared lock free but used by tasks at different priorities - --> $DIR/local-err.rs:74:66 - | -74 | #[task(priority = 2, binds = UART1, resources = [shared, l2, e1])] - | ^^ - -error: unused imports: `debug`, `hprintln` - --> $DIR/local-err.rs:10:28 - | -10 | use cortex_m_semihosting::{debug, hprintln}; - | ^^^^^ ^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/local-err.rs:4:9 - | -4 | #![deny(warnings)] - | ^^^^^^^^ - = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]` - -error: unused import: `lm3s6965::Interrupt` - --> $DIR/local-err.rs:11:5 - | -11 | use lm3s6965::Interrupt; - | ^^^^^^^^^^^^^^^^^^^ diff --git a/ui/single/locals-cfg.rs b/ui/single/locals-cfg.rs deleted file mode 100644 index 72e2aca..0000000 --- a/ui/single/locals-cfg.rs +++ /dev/null @@ -1,49 +0,0 @@ -#![no_main] -use panic_halt as _; - -#[rtic::app(device = lm3s6965, dispatchers = [SSI0])] -mod app { - #[init] - fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { - #[cfg(never)] - static mut FOO: u32 = 0; - - FOO; - - (init::LateResources {}, init::Monotonics()) - } - - #[idle] - fn idle(_: idle::Context) -> ! { - #[cfg(never)] - static mut FOO: u32 = 0; - - FOO; - - loop {} - } - - #[task(binds = SVCall)] - fn svcall(_: svcall::Context) { - #[cfg(never)] - static mut FOO: u32 = 0; - - FOO; - } - - #[task(binds = UART0)] - fn uart0(_: uart0::Context) { - #[cfg(never)] - static mut FOO: u32 = 0; - - FOO; - } - - #[task] - fn foo(_: foo::Context) { - #[cfg(never)] - static mut FOO: u32 = 0; - - FOO; - } -} diff --git a/ui/single/locals-cfg.stderr b/ui/single/locals-cfg.stderr deleted file mode 100644 index 200cea2..0000000 --- a/ui/single/locals-cfg.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0425]: cannot find value `FOO` in this scope - --> $DIR/locals-cfg.rs:11:9 - | -11 | FOO; - | ^^^ not found in this scope - -error[E0425]: cannot find value `FOO` in this scope - --> $DIR/locals-cfg.rs:21:9 - | -21 | FOO; - | ^^^ not found in this scope - -error[E0425]: cannot find value `FOO` in this scope - --> $DIR/locals-cfg.rs:31:9 - | -31 | FOO; - | ^^^ not found in this scope - -error[E0425]: cannot find value `FOO` in this scope - --> $DIR/locals-cfg.rs:39:9 - | -39 | FOO; - | ^^^ not found in this scope - -error[E0425]: cannot find value `FOO` in this scope - --> $DIR/locals-cfg.rs:47:9 - | -47 | FOO; - | ^^^ not found 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-6f77337c1826707d.rlib - = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta diff --git a/ui/single/resources-cfg.rs b/ui/single/resources-cfg.rs deleted file mode 100644 index c11d2ba..0000000 --- a/ui/single/resources-cfg.rs +++ /dev/null @@ -1,79 +0,0 @@ -#![no_main] -use panic_halt as _; - -#[rtic::app(device = lm3s6965)] -mod app { - #[resources] - struct Resources { - #[cfg(never)] - #[init(0)] - o1: u32, // init - - #[cfg(never)] - #[init(0)] - o2: u32, // idle - - #[cfg(never)] - #[init(0)] - o3: u32, // EXTI0 - - #[cfg(never)] - #[init(0)] - o4: u32, // idle - - #[cfg(never)] - #[init(0)] - o5: u32, // EXTI1 - - #[cfg(never)] - #[init(0)] - o6: u32, // init - - #[cfg(never)] - #[init(0)] - s1: u32, // idle & EXTI0 - - #[cfg(never)] - #[init(0)] - s2: u32, // EXTI0 & EXTI1 - - #[cfg(never)] - #[init(0)] - s3: u32, - } - - #[init(resources = [o1, o4, o5, o6, s3])] - fn init(c: init::Context) -> (init::LateResources, init::Monotonics) { - c.resources.o1; - c.resources.o4; - c.resources.o5; - c.resources.o6; - c.resources.s3; - - (init::LateResources {}, init::Monotonics()) - } - - #[idle(resources = [o2, &o4, s1, &s3])] - fn idle(c: idle::Context) -> ! { - c.resources.o2; - c.resources.o4; - c.resources.s1; - c.resources.s3; - - loop {} - } - - #[task(binds = UART0, resources = [o3, s1, s2, &s3])] - fn uart0(c: uart0::Context) { - c.resources.o3; - c.resources.s1; - c.resources.s2; - c.resources.s3; - } - - #[task(binds = UART1, resources = [s2, &o5])] - fn uart1(c: uart1::Context) { - c.resources.s2; - c.resources.o5; - } -} diff --git a/ui/single/resources-cfg.stderr b/ui/single/resources-cfg.stderr deleted file mode 100644 index 3bbbd2d..0000000 --- a/ui/single/resources-cfg.stderr +++ /dev/null @@ -1,125 +0,0 @@ -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-6f77337c1826707d.rlib - = note: second definition in `panic_halt` loaded from $DIR/target/tests/target/x86_64-unknown-linux-gnu/debug/deps/libpanic_halt-ad4cf7fac73711f1.rmeta - -error[E0609]: no field `o1` on type `__rtic_internal_initResources<'_>` - --> $DIR/resources-cfg.rs:47:21 - | -47 | c.resources.o1; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o4` on type `__rtic_internal_initResources<'_>` - --> $DIR/resources-cfg.rs:48:21 - | -48 | c.resources.o4; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o5` on type `__rtic_internal_initResources<'_>` - --> $DIR/resources-cfg.rs:49:21 - | -49 | c.resources.o5; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o6` on type `__rtic_internal_initResources<'_>` - --> $DIR/resources-cfg.rs:50:21 - | -50 | c.resources.o6; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s3` on type `__rtic_internal_initResources<'_>` - --> $DIR/resources-cfg.rs:51:21 - | -51 | c.resources.s3; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o2` on type `__rtic_internal_idleResources<'_>` - --> $DIR/resources-cfg.rs:58:21 - | -58 | c.resources.o2; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o4` on type `__rtic_internal_idleResources<'_>` - --> $DIR/resources-cfg.rs:59:21 - | -59 | c.resources.o4; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s1` on type `__rtic_internal_idleResources<'_>` - --> $DIR/resources-cfg.rs:60:21 - | -60 | c.resources.s1; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s3` on type `__rtic_internal_idleResources<'_>` - --> $DIR/resources-cfg.rs:61:21 - | -61 | c.resources.s3; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o3` on type `__rtic_internal_uart0Resources<'_>` - --> $DIR/resources-cfg.rs:68:21 - | -68 | c.resources.o3; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s1` on type `__rtic_internal_uart0Resources<'_>` - --> $DIR/resources-cfg.rs:69:21 - | -69 | c.resources.s1; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s2` on type `__rtic_internal_uart0Resources<'_>` - --> $DIR/resources-cfg.rs:70:21 - | -70 | c.resources.s2; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s3` on type `__rtic_internal_uart0Resources<'_>` - --> $DIR/resources-cfg.rs:71:21 - | -71 | c.resources.s3; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `s2` on type `__rtic_internal_uart1Resources<'_>` - --> $DIR/resources-cfg.rs:76:21 - | -76 | c.resources.s2; - | ^^ unknown field - | - = note: available fields are: `__marker__` - -error[E0609]: no field `o5` on type `__rtic_internal_uart1Resources<'_>` - --> $DIR/resources-cfg.rs:77:21 - | -77 | c.resources.o5; - | ^^ unknown field - | - = note: available fields are: `__marker__` diff --git a/ui/single/task-priority-too-high.rs b/ui/single/task-priority-too-high.rs deleted file mode 100644 index b1cbfa9..0000000 --- a/ui/single/task-priority-too-high.rs +++ /dev/null @@ -1,38 +0,0 @@ -#![no_main] - -#[rtic::app(device = lm3s6965)] -mod app { - #[init] - fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { - (init::LateResources {}, init::Monotonics()) - } - - #[task(binds = GPIOA, priority = 1)] - fn gpioa(_: gpioa::Context) {} - - #[task(binds = GPIOB, priority = 2)] - fn gpiob(_: gpiob::Context) {} - - #[task(binds = GPIOC, priority = 3)] - fn gpioc(_: gpioc::Context) {} - - #[task(binds = GPIOD, priority = 4)] - fn gpiod(_: gpiod::Context) {} - - #[task(binds = GPIOE, priority = 5)] - fn gpioe(_: gpioe::Context) {} - - #[task(binds = UART0, priority = 6)] - fn uart0(_: uart0::Context) {} - - #[task(binds = UART1, priority = 7)] - fn uart1(_: uart1::Context) {} - - // OK, this is the maximum priority supported by the device - #[task(binds = SSI0, priority = 8)] - fn ssi0(_: ssi0::Context) {} - - // this value is too high! - #[task(binds = I2C0, priority = 9)] - fn i2c0(_: i2c0::Context) {} -} diff --git a/ui/single/task-priority-too-high.stderr b/ui/single/task-priority-too-high.stderr deleted file mode 100644 index 984d3fa..0000000 --- a/ui/single/task-priority-too-high.stderr +++ /dev/null @@ -1,7 +0,0 @@ -error[E0080]: evaluation of constant value failed - --> $DIR/task-priority-too-high.rs:3:1 - | -3 | #[rtic::app(device = lm3s6965)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 9_usize`, which would overflow - | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/ui/task-priority-too-high.rs b/ui/task-priority-too-high.rs new file mode 100644 index 0000000..b1cbfa9 --- /dev/null +++ b/ui/task-priority-too-high.rs @@ -0,0 +1,38 @@ +#![no_main] + +#[rtic::app(device = lm3s6965)] +mod app { + #[init] + fn init(_: init::Context) -> (init::LateResources, init::Monotonics) { + (init::LateResources {}, init::Monotonics()) + } + + #[task(binds = GPIOA, priority = 1)] + fn gpioa(_: gpioa::Context) {} + + #[task(binds = GPIOB, priority = 2)] + fn gpiob(_: gpiob::Context) {} + + #[task(binds = GPIOC, priority = 3)] + fn gpioc(_: gpioc::Context) {} + + #[task(binds = GPIOD, priority = 4)] + fn gpiod(_: gpiod::Context) {} + + #[task(binds = GPIOE, priority = 5)] + fn gpioe(_: gpioe::Context) {} + + #[task(binds = UART0, priority = 6)] + fn uart0(_: uart0::Context) {} + + #[task(binds = UART1, priority = 7)] + fn uart1(_: uart1::Context) {} + + // OK, this is the maximum priority supported by the device + #[task(binds = SSI0, priority = 8)] + fn ssi0(_: ssi0::Context) {} + + // this value is too high! + #[task(binds = I2C0, priority = 9)] + fn i2c0(_: i2c0::Context) {} +} diff --git a/ui/task-priority-too-high.stderr b/ui/task-priority-too-high.stderr new file mode 100644 index 0000000..984d3fa --- /dev/null +++ b/ui/task-priority-too-high.stderr @@ -0,0 +1,7 @@ +error[E0080]: evaluation of constant value failed + --> $DIR/task-priority-too-high.rs:3:1 + | +3 | #[rtic::app(device = lm3s6965)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `8_usize - 9_usize`, which would overflow + | + = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) -- cgit v1.2.3