Switch to using rtt for cargo embed, update deps
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -1,12 +1,14 @@
|
||||
#![no_std]
|
||||
#![no_main]
|
||||
#![cfg_attr(not(doc), no_main)]
|
||||
|
||||
use core::{
|
||||
cell::RefCell,
|
||||
fmt::Write,
|
||||
};
|
||||
|
||||
use panic_halt as _;
|
||||
use rtt_target::{rprintln, rtt_init_print};
|
||||
use panic_rtt_target as _;
|
||||
|
||||
|
||||
use cortex_m_rt::entry;
|
||||
|
||||
@@ -64,6 +66,9 @@ static COUNT: Mutex<RefCell<i32>> = Mutex::new(RefCell::new(0));
|
||||
|
||||
#[entry]
|
||||
fn main() -> ! {
|
||||
// Init buffers for debug printing
|
||||
rtt_init_print!();
|
||||
|
||||
// Get access to the core peripherals from the cortex-m crate
|
||||
let mut core_periph = CorePeripherals::take().unwrap();
|
||||
|
||||
@@ -170,6 +175,8 @@ fn main() -> ! {
|
||||
// Turn the LED on via the OutputPin trait
|
||||
led.on().unwrap();
|
||||
|
||||
rprintln!("Finished init, starting main loop");
|
||||
|
||||
let mut button_last = false;
|
||||
// Microcontroller programs never exit main, so we must loop!
|
||||
loop {
|
||||
|
Reference in New Issue
Block a user