Skip to content
Snippets Groups Projects
Commit 42c3efdc authored by Gustav Hansson's avatar Gustav Hansson
Browse files

bare3_5

parent 021545b2
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,8 @@ extern crate panic_halt;
use cortex_m_rt::entry;
use cortex_m_semihosting::{hprint, hprintln};
use core::convert::TryInto;
#[entry]
fn main() -> ! {
hprintln!("bare3").unwrap();
......@@ -29,14 +31,17 @@ fn main() -> ! {
hprint!("{},", c as &u8).unwrap();
}
let mut a = [0u8; 4];
hprintln!("iterate iterate using (raw) indexing").unwrap();
for i in 0usize..s.len() {
hprintln!("{},", bs[i]).unwrap();
a[i] = bs[i];
// a[i] = bs[i];
}
let a: [u8; 4];
// a = bs.into();
a = bs.try_into().expect("incorrect length");
hprintln!("").unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment