Skip to content

Commit 027239c

Browse files
committed
Fix clippy lint
clippy::empty-loop
1 parent c695ccf commit 027239c

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

examples/can.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use panic_semihosting as _;
66

77
use stm32f3xx_hal as hal;
88

9+
use cortex_m::asm;
910
use cortex_m_rt::entry;
1011

11-
use cortex_m::asm;
1212
use hal::prelude::*;
1313
use hal::stm32;
1414
use hal::watchdog::IndependentWatchDog;

examples/pwm.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use panic_semihosting as _;
77

88
use stm32f3xx_hal as hal;
99

10+
use cortex_m::asm;
1011
use cortex_m_rt::entry;
1112

1213
//use cortex_m_semihosting::hprintln;
@@ -148,5 +149,7 @@ fn main() -> ! {
148149
// DOES NOT COMPILE
149150
// tim8_ch1.output_to_pc6(gpioc.pc6.into_af4(&mut gpioc.moder, &mut gpioc.afrl));
150151

151-
loop {}
152+
loop {
153+
asm::wfi();
154+
}
152155
}

examples/serial_dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use panic_semihosting as _;
99

10-
use cortex_m::singleton;
10+
use cortex_m::{asm, singleton};
1111
use cortex_m_rt::entry;
1212
use stm32f3xx_hal::{pac, prelude::*, serial::Serial};
1313

@@ -63,6 +63,6 @@ fn main() -> ! {
6363
assert_eq!(tx_buf, rx_buf);
6464

6565
loop {
66-
continue;
66+
asm::wfi();
6767
}
6868
}

examples/spi.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use panic_semihosting as _;
77

88
use stm32f3xx_hal as hal;
99

10+
use cortex_m::asm;
1011
use cortex_m_rt::entry;
1112

1213
use hal::pac;
@@ -61,5 +62,7 @@ fn main() -> ! {
6162
// This succeeds, when master and slave of the SPI are connected.
6263
assert_eq!(msg_send, msg_received);
6364

64-
loop {}
65+
loop {
66+
asm::wfi();
67+
}
6568
}

0 commit comments

Comments
 (0)