From eeca2a410e4c34620e4e40e5a609a1f34bafb9ab Mon Sep 17 00:00:00 2001 From: ssnover Date: Sat, 5 Nov 2022 17:32:58 -0600 Subject: [PATCH] Remove wfi in examples --- examples/blinky_rtcalarm_irq.rs | 6 ++---- examples/blinky_timer_irq.rs | 7 +++---- examples/serial-interrupt-idle.rs | 5 ++--- examples/usb_serial_interrupt.rs | 8 ++++---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/examples/blinky_rtcalarm_irq.rs b/examples/blinky_rtcalarm_irq.rs index 4aab935c..29efb2df 100644 --- a/examples/blinky_rtcalarm_irq.rs +++ b/examples/blinky_rtcalarm_irq.rs @@ -24,7 +24,7 @@ use crate::hal::{ }; use core::cell::RefCell; -use cortex_m::{asm::wfi, interrupt::Mutex}; +use cortex_m::interrupt::Mutex; use cortex_m_rt::entry; // A type definition for the GPIO pin to be used for our LED @@ -108,7 +108,5 @@ fn main() -> ! { // Enable RTCALARM IRQ unsafe { cortex_m::peripheral::NVIC::unmask(Interrupt::RTCALARM) }; - loop { - wfi(); - } + loop {} } diff --git a/examples/blinky_timer_irq.rs b/examples/blinky_timer_irq.rs index c3a8f9f7..37e429be 100644 --- a/examples/blinky_timer_irq.rs +++ b/examples/blinky_timer_irq.rs @@ -7,6 +7,7 @@ //! GPIOs PC13 to PC15 in output mode is restricted: the speed has to be limited to 2MHz with //! a maximum load of 30pF and these IOs must not be used as a current source (e.g. to drive a LED)" +#![allow(clippy::empty_loop)] #![no_main] #![no_std] @@ -22,7 +23,7 @@ use crate::hal::{ }; use core::cell::RefCell; -use cortex_m::{asm::wfi, interrupt::Mutex}; +use cortex_m::interrupt::Mutex; use cortex_m_rt::entry; // NOTE You can uncomment 'hprintln' here and in the code below for a bit more @@ -99,7 +100,5 @@ fn main() -> ! { cortex_m::peripheral::NVIC::unmask(Interrupt::TIM2); } - loop { - wfi(); - } + loop {} } diff --git a/examples/serial-interrupt-idle.rs b/examples/serial-interrupt-idle.rs index ac48deca..c0daeac6 100644 --- a/examples/serial-interrupt-idle.rs +++ b/examples/serial-interrupt-idle.rs @@ -2,6 +2,7 @@ //! //! You have to short the TX and RX pins to make this program work +#![allow(clippy::empty_loop)] #![no_main] #![no_std] @@ -64,9 +65,7 @@ fn main() -> ! { cortex_m::peripheral::NVIC::unmask(pac::Interrupt::USART1); } - loop { - cortex_m::asm::wfi() - } + loop {} } const BUFFER_LEN: usize = 4096; static mut BUFFER: &mut [u8; BUFFER_LEN] = &mut [0; BUFFER_LEN]; diff --git a/examples/usb_serial_interrupt.rs b/examples/usb_serial_interrupt.rs index 102b9f82..d814b871 100644 --- a/examples/usb_serial_interrupt.rs +++ b/examples/usb_serial_interrupt.rs @@ -1,11 +1,13 @@ //! CDC-ACM serial port example using interrupts. //! Target board: Blue Pill + +#![allow(clippy::empty_loop)] #![no_std] #![no_main] extern crate panic_semihosting; -use cortex_m::asm::{delay, wfi}; +use cortex_m::asm::delay; use cortex_m_rt::entry; use stm32f1xx_hal::pac::{self, interrupt, Interrupt, NVIC}; use stm32f1xx_hal::prelude::*; @@ -75,9 +77,7 @@ fn main() -> ! { NVIC::unmask(Interrupt::USB_LP_CAN_RX0); } - loop { - wfi(); - } + loop {} } #[interrupt]