Skip to content

Commit

Permalink
Use asm::nop in empty loops
Browse files Browse the repository at this point in the history
  • Loading branch information
mattico committed Feb 13, 2021
1 parent aca0d52 commit bd7b276
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clippy.yml
Expand Up @@ -19,4 +19,4 @@ jobs:
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --examples --target thumbv7em-none-eabihf --features=rt,stm32h743v -- -A clippy::empty_loop
args: --examples --target thumbv7em-none-eabihf --features=rt,stm32h743v
4 changes: 3 additions & 1 deletion examples/dma.rs
Expand Up @@ -104,5 +104,7 @@ fn main() -> ! {

info!("Memory to Memory DMA completed successfully");

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/fmc.rs
Expand Up @@ -213,6 +213,8 @@ const APP: () = {

assert_eq!(ram_slice[0], 1);

loop {}
loop {
cortex_m::asm::nop()
}
}
};
4 changes: 3 additions & 1 deletion examples/fractional-pll.rs
Expand Up @@ -51,5 +51,7 @@ fn main() -> ! {

let _mco2_ck = ccdr.clocks.mco2_ck().unwrap().0;

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/i2c4_bdma.rs
Expand Up @@ -129,5 +129,7 @@ fn I2C4_EV() {

assert_eq!(buffer[0], 0xBE);

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/mco.rs
Expand Up @@ -59,5 +59,7 @@ fn main() -> ! {

info!("MCO outputs running!");

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/prec_kernel_clocks.rs
Expand Up @@ -49,5 +49,7 @@ fn main() -> ! {
// Can't change group clocks - ccdr.peripheral has been partially used
//ccdr.peripheral.kernel_i2c123_clk_mux(I2c123ClkSel::HSI_KER);

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/pwm.rs
Expand Up @@ -78,5 +78,7 @@ fn main() -> ! {
pwm.set_duty(max / 2);
pwm.enable();

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/rcc.rs
Expand Up @@ -37,5 +37,7 @@ fn main() -> ! {
info!("sys_ck = {} MHz", ccdr.clocks.sys_ck().0 as f32 / 1e6);
assert_eq!(ccdr.clocks.sys_ck().0, 100_000_000);

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/sdmmc.rs
Expand Up @@ -166,5 +166,7 @@ fn main() -> ! {

info!("Done!");

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/spi-dma.rs
Expand Up @@ -176,5 +176,7 @@ fn main() -> ! {

// We could re-use the stream or spi here

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/vos0.rs
Expand Up @@ -41,5 +41,7 @@ fn main() -> ! {
info!("sys_ck = {} MHz", ccdr.clocks.sys_ck().0 as f32 / 1e6);
assert_eq!(ccdr.clocks.sys_ck().0, 480_000_000);

loop {}
loop {
cortex_m::asm::nop()
}
}
4 changes: 3 additions & 1 deletion examples/watchdog.rs
Expand Up @@ -45,5 +45,7 @@ fn main() -> ! {
// -> restart the chip
watchdog.start(100.ms());

loop {}
loop {
cortex_m::asm::nop()
}
}

0 comments on commit bd7b276

Please sign in to comment.