kirdy/src/main.rs

31 lines
600 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::{
watchdog::IndependentWatchdog,
rcc::RccExt,
pac::{CorePeripherals, Peripherals},
time::MegaHertz, prelude::_stm32f4xx_hal_gpio_GpioExt,
};
use log::info;
mod device;
2022-10-20 21:21:01 +08:00
use device::boot::bootup;
use device::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
}