Skip to content
Snippets Groups Projects
Select Git revision
  • 046d614b378017bcb9389a0ea9ca19b658716196
  • master default protected
2 results

gpio.rs

Blame
  • gpio.rs 409 B
    //! Sets PB12 high
    #![deny(unsafe_code)]
    #![deny(warnings)]
    #![feature(proc_macro)]
    #![no_std]
    
    extern crate blue_pill;
    extern crate cortex_m_rtfm as rtfm;
    
    use blue_pill::gpio::{self, PB12};
    use rtfm::app;
    
    app! {
        device: blue_pill::stm32f103xx,
    }
    
    fn init(p: init::Peripherals) {
        gpio::init(p.GPIOB, p.RCC);
    }
    
    fn idle() -> ! {
        PB12.high();
    
        // Sleep
        loop {
            rtfm::wfi();
        }
    }