From 582c602912592ec7ebea3096aefa02aea99c2143 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Mon, 2 Jan 2023 14:34:05 +0100 Subject: Old xtask test pass --- examples/binds.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs index 1b0c8c5..56565cb 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -2,7 +2,6 @@ #![deny(unsafe_code)] #![deny(warnings)] -#![deny(missing_docs)] #![no_main] #![no_std] @@ -24,22 +23,21 @@ mod app { fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { rtic::pend(Interrupt::UART0); - hprintln!("init"); + hprintln!("init").unwrap(); (Shared {}, Local {}, init::Monotonics()) } #[idle] fn idle(_: idle::Context) -> ! { - hprintln!("idle"); + hprintln!("idle").unwrap(); rtic::pend(Interrupt::UART0); + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator + loop { - // Exit moved after nop to ensure that rtic::pend gets - // to run before exiting cortex_m::asm::nop(); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } @@ -51,6 +49,7 @@ mod app { "foo called {} time{}", *cx.local.times, if *cx.local.times > 1 { "s" } else { "" } - ); + ) + .unwrap(); } } -- cgit v1.2.3 From 9a4f97ca5ebf19e6612115db5c763d0d61dd28a1 Mon Sep 17 00:00:00 2001 From: Per Lindgren Date: Sat, 7 Jan 2023 17:59:39 +0100 Subject: more examples --- examples/binds.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs index 56565cb..ec25ccc 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -20,12 +20,12 @@ mod app { struct Local {} #[init] - fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { + fn init(_: init::Context) -> (Shared, Local) { rtic::pend(Interrupt::UART0); hprintln!("init").unwrap(); - (Shared {}, Local {}, init::Monotonics()) + (Shared {}, Local {}) } #[idle] -- cgit v1.2.3 From ceaf3613d3256f60b139a4f93220e3c298603b83 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 8 Jan 2023 19:40:31 +0100 Subject: Update semihosting --- examples/binds.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs index ec25ccc..d78dffb 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -23,14 +23,14 @@ mod app { fn init(_: init::Context) -> (Shared, Local) { rtic::pend(Interrupt::UART0); - hprintln!("init").unwrap(); + hprintln!("init"); (Shared {}, Local {}) } #[idle] fn idle(_: idle::Context) -> ! { - hprintln!("idle").unwrap(); + hprintln!("idle"); rtic::pend(Interrupt::UART0); @@ -49,7 +49,6 @@ mod app { "foo called {} time{}", *cx.local.times, if *cx.local.times > 1 { "s" } else { "" } - ) - .unwrap(); + ); } } -- cgit v1.2.3 From 35c97b61c17a30de675eb1c7f852a100b200a0c2 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 8 Jan 2023 19:56:47 +0100 Subject: All examples pass with `cargo xtask --target all` --- examples/binds.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs index d78dffb..0c1ed97 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -34,10 +34,9 @@ mod app { rtic::pend(Interrupt::UART0); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - loop { cortex_m::asm::nop(); + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } -- cgit v1.2.3 From b8b881f446a226d6f3c4a7db7c9174590b47dbf6 Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Thu, 19 Jan 2023 13:56:59 +0100 Subject: Fix so deny(missing_docs) work --- examples/binds.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs index 0c1ed97..cf078ff 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -4,6 +4,7 @@ #![deny(warnings)] #![no_main] #![no_std] +#![deny(missing_docs)] use panic_semihosting as _; -- cgit v1.2.3 From 306aa47170fd59369b7a184924e287dc3706d64d Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Mon, 23 Jan 2023 20:05:47 +0100 Subject: Add rtic-timer (timerqueue + monotonic) and rtic-monotonics (systick-monotonic) --- examples/binds.rs | 54 ------------------------------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 examples/binds.rs (limited to 'examples/binds.rs') diff --git a/examples/binds.rs b/examples/binds.rs deleted file mode 100644 index cf078ff..0000000 --- a/examples/binds.rs +++ /dev/null @@ -1,54 +0,0 @@ -//! examples/binds.rs - -#![deny(unsafe_code)] -#![deny(warnings)] -#![no_main] -#![no_std] -#![deny(missing_docs)] - -use panic_semihosting as _; - -// `examples/interrupt.rs` rewritten to use `binds` -#[rtic::app(device = lm3s6965)] -mod app { - use cortex_m_semihosting::{debug, hprintln}; - use lm3s6965::Interrupt; - - #[shared] - struct Shared {} - - #[local] - struct Local {} - - #[init] - fn init(_: init::Context) -> (Shared, Local) { - rtic::pend(Interrupt::UART0); - - hprintln!("init"); - - (Shared {}, Local {}) - } - - #[idle] - fn idle(_: idle::Context) -> ! { - hprintln!("idle"); - - rtic::pend(Interrupt::UART0); - - loop { - cortex_m::asm::nop(); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - } - } - - #[task(binds = UART0, local = [times: u32 = 0])] - fn foo(cx: foo::Context) { - *cx.local.times += 1; - - hprintln!( - "foo called {} time{}", - *cx.local.times, - if *cx.local.times > 1 { "s" } else { "" } - ); - } -} -- cgit v1.2.3