Skip to content

Instantly share code, notes, and snippets.

@bofh
Created March 17, 2018 16:51
Show Gist options
  • Save bofh/4147ee1d1e2a1e72c68bde1371423bb0 to your computer and use it in GitHub Desktop.
Save bofh/4147ee1d1e2a1e72c68bde1371423bb0 to your computer and use it in GitHub Desktop.
#![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