From 1fe587c5160b9e99bbb67644318cb9e5c9c56b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 11 Jan 2023 21:33:44 +0100 Subject: Remove unwrap() from hprintln!() sd 'hprintln(.*).unwrap\(\)' 'hprintln' (fd -e rs .) --- examples/extern_binds.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/extern_binds.rs') diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index 4dc6633..b6df2fb 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -29,14 +29,14 @@ mod app { fn init(_: init::Context) -> (Shared, Local, init::Monotonics) { rtic::pend(Interrupt::UART0); - hprintln!("init").unwrap(); + hprintln!("init"); (Shared {}, Local {}, init::Monotonics()) } #[idle] fn idle(_: idle::Context) -> ! { - hprintln!("idle").unwrap(); + hprintln!("idle"); rtic::pend(Interrupt::UART0); -- cgit v1.2.3 From c370c0b21f054fa224680b95df63ca3d59f33ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Wed, 11 Jan 2023 21:40:33 +0100 Subject: Remove ok() from hprintln!() sd 'hprintln(.*).ok\(\)' 'hprintln' (fd -e rs .) --- examples/extern_binds.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/extern_binds.rs') diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index b6df2fb..e445f4e 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -10,7 +10,7 @@ use panic_semihosting as _; // Free function implementing the interrupt bound task `foo`. fn foo(_: app::foo::Context) { - hprintln!("foo called").ok(); + hprintln!("foo called"); } #[rtic::app(device = lm3s6965)] -- cgit v1.2.3 From 9764121cc1cdd6a7c27e86fa8d65bb6d2d48dc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 14 Jan 2023 11:24:51 +0100 Subject: Upgrade of semihosting changed timing New semihosting 0.5 does not use error handling, returns directly and as semihosting is generally slow this led to missing print statements. Workaround is to add NOP, which seems sufficient to let it flush the buffers --- examples/extern_binds.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples/extern_binds.rs') diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index e445f4e..c2186cb 100644 --- a/examples/extern_binds.rs +++ b/examples/extern_binds.rs @@ -40,10 +40,11 @@ mod app { rtic::pend(Interrupt::UART0); - debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator - loop { cortex_m::asm::nop(); + // Exit moved after nop to ensure that rtic::pend gets + // to run before exiting + debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator } } -- cgit v1.2.3