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

so i can pull

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