diff options
author | 2023-01-14 11:24:51 +0100 | |
---|---|---|
committer | 2023-01-14 11:24:51 +0100 | |
commit | 9764121cc1cdd6a7c27e86fa8d65bb6d2d48dc27 (patch) | |
tree | 3b907bc803726d4917429f2db3af7725a67020ad | |
parent | 050313d62d84dd9f537bbc578213f18cd7640d04 (diff) | |
download | rtic-9764121cc1cdd6a7c27e86fa8d65bb6d2d48dc27.tar.gz rtic-9764121cc1cdd6a7c27e86fa8d65bb6d2d48dc27.tar.zst rtic-9764121cc1cdd6a7c27e86fa8d65bb6d2d48dc27.zip |
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
-rw-r--r-- | examples/binds.rs | 5 | ||||
-rw-r--r-- | examples/extern_binds.rs | 5 | ||||
-rw-r--r-- | examples/generics.rs | 3 | ||||
-rw-r--r-- | examples/hardware.rs | 5 |
4 files changed, 12 insertions, 6 deletions
diff --git a/examples/binds.rs b/examples/binds.rs index db5bd96f..601f245a 100644 --- a/examples/binds.rs +++ b/examples/binds.rs @@ -34,10 +34,11 @@ mod app { 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 } } diff --git a/examples/extern_binds.rs b/examples/extern_binds.rs index e445f4ec..c2186cb7 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 } } diff --git a/examples/generics.rs b/examples/generics.rs index f9a6aacf..6243d562 100644 --- a/examples/generics.rs +++ b/examples/generics.rs @@ -39,6 +39,9 @@ mod app { rtic::pend(Interrupt::UART1); + // 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 } diff --git a/examples/hardware.rs b/examples/hardware.rs index 8f294559..590bf6ab 100644 --- a/examples/hardware.rs +++ b/examples/hardware.rs @@ -37,10 +37,11 @@ mod app { 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 } } |