1
0
Fork 0
kirdy-firmware/src/main.rs

32 lines
506 B
Rust
Raw Normal View History

2022-10-20 15:17:43 +08:00
#![no_main]
#![no_std]
use panic_halt as _;
use cortex_m_rt::entry;
2022-10-20 20:57:24 +08:00
use stm32f4xx_hal::{
2022-10-21 12:05:55 +08:00
pac::{CorePeripherals, Peripherals}
2022-10-20 20:57:24 +08:00
};
use log::info;
2022-10-21 12:05:55 +08:00
2022-10-20 20:57:24 +08:00
mod device;
2022-10-21 12:05:55 +08:00
mod laser_diode;
use device::{
boot::bootup,
sys_timer
};
2022-10-20 15:17:43 +08:00
#[entry]
fn main() -> ! {
2022-10-20 20:57:24 +08:00
let mut core_perif = CorePeripherals::take().unwrap();
let perif = Peripherals::take().unwrap();
2022-10-20 21:21:01 +08:00
let (mut wd) = bootup(core_perif, perif);
2022-10-20 20:57:24 +08:00
loop {
wd.feed();
2022-10-20 21:21:01 +08:00
info!("looping");
sys_timer::sleep(10);
2022-10-20 20:57:24 +08:00
}
2022-10-20 15:17:43 +08:00
}