Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
45 lines (34 sloc) 870 Bytes
//! Turns all the user LEDs on
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate f3;
use f3::hal::stm32f30x;
use f3::hal::prelude::*;
use f3::led::Leds;
use cortex_m::asm;
fn main() {
let p = stm32f30x::Peripherals::take().unwrap();
let mut rcc = p.RCC.constrain();
let gpioe = p.GPIOE.split(&mut rcc.ahb);
let mut leds = Leds::new(gpioe);
for led in leds.iter_mut() {
// As we are not using interrupts, we just register a dummy catch all handler
#[link_section = ".vector_table.interrupts"]
static INTERRUPTS: [extern "C" fn(); 240] = [default_handler; 240];
extern "C" fn default_handler() {
#[lang = "panic_fmt"]
pub extern "C" fn panic_fmt() -> ! {
loop {}