Skip to content
Snippets Groups Projects
Commit fa985cb9 authored by Anton Grahn's avatar Anton Grahn
Browse files

so i can pull

parent da193fc7
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@ nb = "0.1.2"
[dependencies.cortex-m]
version = "0.6.2"
# features = ["inline-asm"] # <- currently requires nightly compiler
features = ["inline-asm"] # <- currently requires nightly compiler
[dependencies.cortex-m-rt]
version = "0.6.12"
......
......@@ -59,7 +59,8 @@ fn main() -> ! {
// What happens when you continue (second iteration of the loop)?
//
// ** your answer here **
//
// The program panics "panicked at 'attempt to add with overflow', examples/bare1.rs:23:9 "
// What is the `ITM` output.
//
// ** your answer here **
......
......@@ -8,7 +8,6 @@
//! buffer may overflow.
#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]
......@@ -20,12 +19,11 @@ extern crate stm32f4xx_hal as hal;
use crate::hal::prelude::*;
use crate::hal::serial::{config::Config, Serial};
use cortex_m::iprintln;
use cortex_m_semihosting::hprintln;
#[entry]
fn main() -> ! {
let mut c = hal::stm32::CorePeripherals::take().unwrap();
let stim = &mut c.ITM.stim[0];
//let stim = &mut c.ITM.stim[0];
let p = hal::stm32::Peripherals::take().unwrap();
......@@ -51,13 +49,13 @@ fn main() -> ! {
let (mut tx, mut rx) = serial.split();
loop {
match block!(rx.read()) {
match rx.read() {
Ok(byte) => {
iprintln!(stim, "Ok {:?}", byte);
hprintln!("Ok {:?}", byte).unwrap();
let _ = tx.write(byte);
}
Err(err) => {
iprintln!(stim, "Error {:?}", err);
hprintln!( "Error {:?}", err).unwrap();
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment