Switch to using rtt for cargo embed, update deps

This commit is contained in:
2020-07-10 01:29:18 -06:00
parent 2796c15208
commit 8a2c59843f
3 changed files with 63 additions and 9 deletions

View File

@@ -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 {