Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit ac02415

Browse files
authored
Merge pull request #132 from rust-embedded/no-nop
Remove unnecessary nop from main loops
2 parents 0f9748a + 6aa2550 commit ac02415

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

examples/test_on_host.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch
2828
// use panic_itm as _; // logs messages over ITM; requires ITM support
2929
// use panic_semihosting as _; // logs messages to the host stderr; requires a debugger
3030

31-
use cortex_m::asm;
3231
use cortex_m_rt::entry;
3332

3433
#[cfg(not(test))]
3534
#[entry]
3635
fn main() -> ! {
37-
asm::nop(); // To not have main optimize to abort in release mode, remove when you add code
38-
3936
loop {
4037
// your code goes here
4138
}

src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch
77
// use panic_itm as _; // logs messages over ITM; requires ITM support
88
// use panic_semihosting as _; // logs messages to the host stderr; requires a debugger
99

10-
use cortex_m::asm;
1110
use cortex_m_rt::entry;
1211

1312
#[entry]
1413
fn main() -> ! {
15-
asm::nop(); // To not have main optimize to abort in release mode, remove when you add code
16-
1714
loop {
1815
// your code goes here
1916
}

0 commit comments

Comments
 (0)