50 lines
940 B
Rust
50 lines
940 B
Rust
#![deny(unsafe_code)]
|
|
#![no_std]
|
|
#![no_main]
|
|
|
|
use cortex_m::asm;
|
|
use cortex_m_rt::{entry, exception};
|
|
|
|
use rtt_target::{rprintln, rtt_init_print};
|
|
|
|
use stm32f1xx_hal::pac;
|
|
|
|
mod application;
|
|
mod max6675;
|
|
mod profiles;
|
|
|
|
#[entry]
|
|
fn main() -> ! {
|
|
rtt_init_print!();
|
|
rprintln!("Startup!");
|
|
|
|
// Get access to the core peripherals from the cortex-m crate
|
|
let cp = cortex_m::Peripherals::take().unwrap();
|
|
// Get access to the device specific peripherals from the peripheral access crate
|
|
let dp = pac::Peripherals::take().unwrap();
|
|
|
|
rprintln!("Application Setup");
|
|
let app = application::setup(cp, dp);
|
|
rprintln!("Application Setup done");
|
|
|
|
app.run()
|
|
}
|
|
|
|
#[exception]
|
|
fn PendSV() {
|
|
rprintln!("PendSV");
|
|
panic!()
|
|
}
|
|
|
|
#[panic_handler]
|
|
fn panic(info: &core::panic::PanicInfo) -> ! {
|
|
rprintln!("{}", info);
|
|
exit()
|
|
}
|
|
|
|
fn exit() -> ! {
|
|
loop {
|
|
asm::bkpt() // halt = exit probe-run
|
|
}
|
|
}
|