From 6aa25500e63e8bd6c1b20d25147d0bf1e3ab9aa1 Mon Sep 17 00:00:00 2001 From: Adam Greig Date: Tue, 17 Jun 2025 19:11:13 +0100 Subject: [PATCH] Remove unnecessary nop from main loops --- examples/test_on_host.rs | 3 --- src/main.rs | 3 --- 2 files changed, 6 deletions(-) diff --git a/examples/test_on_host.rs b/examples/test_on_host.rs index c831f11..a50539d 100644 --- a/examples/test_on_host.rs +++ b/examples/test_on_host.rs @@ -28,14 +28,11 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch // use panic_itm as _; // logs messages over ITM; requires ITM support // use panic_semihosting as _; // logs messages to the host stderr; requires a debugger -use cortex_m::asm; use cortex_m_rt::entry; #[cfg(not(test))] #[entry] fn main() -> ! { - asm::nop(); // To not have main optimize to abort in release mode, remove when you add code - loop { // your code goes here } diff --git a/src/main.rs b/src/main.rs index 7922596..5edf396 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,13 +7,10 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch // use panic_itm as _; // logs messages over ITM; requires ITM support // use panic_semihosting as _; // logs messages to the host stderr; requires a debugger -use cortex_m::asm; use cortex_m_rt::entry; #[entry] fn main() -> ! { - asm::nop(); // To not have main optimize to abort in release mode, remove when you add code - loop { // your code goes here }