Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove wfi in examples #450

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions examples/blinky_rtcalarm_irq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -108,7 +108,5 @@ fn main() -> ! {
// Enable RTCALARM IRQ
unsafe { cortex_m::peripheral::NVIC::unmask(Interrupt::RTCALARM) };

loop {
wfi();
}
loop {}
}
7 changes: 3 additions & 4 deletions examples/blinky_timer_irq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
Expand Down Expand Up @@ -99,7 +100,5 @@ fn main() -> ! {
cortex_m::peripheral::NVIC::unmask(Interrupt::TIM2);
}

loop {
wfi();
}
loop {}
}
5 changes: 2 additions & 3 deletions examples/serial-interrupt-idle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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];
Expand Down
8 changes: 4 additions & 4 deletions examples/usb_serial_interrupt.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down Expand Up @@ -75,9 +77,7 @@ fn main() -> ! {
NVIC::unmask(Interrupt::USB_LP_CAN_RX0);
}

loop {
wfi();
}
loop {}
}

#[interrupt]
Expand Down