mirror of
https://github.com/italicsjenga/rp-hal-boards.git
synced 2025-02-23 23:57:43 +11:00
Merge pull request #408 from jannic/wfi
Use wfi in otherwise empty infinite loops in examples
This commit is contained in:
commit
575aba4bfe
11 changed files with 19 additions and 23 deletions
|
@ -149,7 +149,7 @@ fn main() -> ! {
|
|||
print_temperature(&mut uart, temp);
|
||||
|
||||
loop {
|
||||
cortex_m::asm::nop();
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -139,9 +139,8 @@ fn main() -> ! {
|
|||
// In this case, we just ignore the result. A real application
|
||||
// would do something with the measurement.
|
||||
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {
|
||||
// Empty loop
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -147,11 +147,7 @@ fn main() -> ! {
|
|||
|
||||
loop {
|
||||
// interrupts handle everything else in this example.
|
||||
// if we wanted low power we could go to sleep. to
|
||||
// keep this example simple we'll just execute a `nop`.
|
||||
// the `nop` (No Operation) instruction does nothing,
|
||||
// but if we have no code here clippy would complain.
|
||||
cortex_m::asm::nop();
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -97,9 +97,8 @@ fn main() -> ! {
|
|||
|
||||
// Demo finish - just loop until reset
|
||||
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {
|
||||
// Empty loop
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -113,9 +113,8 @@ fn main() -> ! {
|
|||
lcd.write_str("HD44780!", &mut delay).unwrap();
|
||||
|
||||
// Do nothing - we're finished
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {
|
||||
// Empty loop
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ fn main() -> ! {
|
|||
sm.start();
|
||||
|
||||
// PIO runs in background, independently from CPU
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {}
|
||||
loop {
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ fn main() -> ! {
|
|||
sm.start();
|
||||
|
||||
// PIO runs in background, independently from CPU
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {}
|
||||
loop {
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ fn main() -> ! {
|
|||
sm.start();
|
||||
|
||||
// PIO runs in background, independently from CPU
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {}
|
||||
loop {
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ fn main() -> ! {
|
|||
cortex_m::asm::delay(10_000_000);
|
||||
let _sm2 = sm2.stop();
|
||||
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {}
|
||||
loop {
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ fn main() -> ! {
|
|||
|
||||
// In case the reboot fails
|
||||
loop {
|
||||
cortex_m::asm::nop();
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -121,9 +121,8 @@ fn main() -> ! {
|
|||
Err(_) => {} // handle errors
|
||||
};
|
||||
|
||||
#[allow(clippy::empty_loop)]
|
||||
loop {
|
||||
// Empty loop
|
||||
cortex_m::asm::wfi();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue