Created
March 17, 2018 16:51
-
-
Save bofh/4147ee1d1e2a1e72c68bde1371423bb0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![deny(unsafe_code)] | |
#![deny(warnings)] | |
#![no_std] | |
extern crate cortex_m; | |
extern crate embedded_hal as ehal; | |
extern crate stm32f30x_hal as hal; | |
mod beeper; | |
use hal::prelude::*; | |
use hal::stm32f30x; | |
//use cortex_m::asm; | |
fn main() { | |
let dp = stm32f30x::Peripherals::take().unwrap(); | |
let mut rcc = dp.RCC.constrain(); | |
let mut gpioc = dp.GPIOC.split(&mut rcc.ahb); | |
let beep = beeper::Beeper::new(gpioc); | |
loop { | |
beep.on(); | |
beep.off(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment