diff --git a/Cargo.toml b/Cargo.toml index 701aef8..f2d9b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ optional = true version = "0.5.0" [dev-dependencies] -cortex-m-semihosting = "0.3.7" +cortex-m-semihosting = "0.5.0" panic-halt = "0.2.0" panic-semihosting = "0.6.0" embedded-graphics = "0.6.2" diff --git a/examples/flash.rs b/examples/flash.rs index 3a3f85b..5f818ca 100644 --- a/examples/flash.rs +++ b/examples/flash.rs @@ -39,7 +39,7 @@ fn main() -> ! { // Compare the written data with the expected value. if flash_data == DATA { - hprintln!("Flash programming successful").unwrap(); + hprintln!("Flash programming successful"); } loop {} diff --git a/examples/fmc.rs b/examples/fmc.rs index 139bf87..8860072 100644 --- a/examples/fmc.rs +++ b/examples/fmc.rs @@ -124,7 +124,7 @@ fn main() -> ! { } } - hprintln!("Success!").unwrap(); + hprintln!("Success!"); loop {} } diff --git a/examples/hello.rs b/examples/hello.rs index b44841d..3fe9250 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -13,6 +13,6 @@ use cortex_m_semihosting::hprintln; #[entry] fn main() -> ! { - hprintln!("Hello, world!").unwrap(); + hprintln!("Hello, world!"); loop {} } diff --git a/examples/i2c_scanner.rs b/examples/i2c_scanner.rs index 084ceac..fa65029 100644 --- a/examples/i2c_scanner.rs +++ b/examples/i2c_scanner.rs @@ -36,26 +36,26 @@ fn main() -> ! { 50_000, ); - hprintln!("Start i2c scanning...").expect("Error using hprintln."); - hprintln!().unwrap(); + hprintln!("Start i2c scanning..."); + hprintln!(); for addr in 0x00_u8..0x80 { // Write the empty array and check the slave response. let byte: [u8; 1] = [0; 1]; if VALID_ADDR_RANGE.contains(&addr) && i2c.write(addr, &byte).is_ok() { - hprint!("{:02x}", addr).unwrap(); + hprint!("{:02x}", addr); } else { - hprint!("..").unwrap(); + hprint!(".."); } if addr % 0x10 == 0x0F { - hprintln!().unwrap(); + hprintln!(); } else { - hprint!(" ").unwrap(); + hprint!(" "); } } - hprintln!().unwrap(); - hprintln!("Done!").unwrap(); + hprintln!(); + hprintln!("Done!"); loop {} } diff --git a/examples/rng.rs b/examples/rng.rs index 5bc8f24..96e1d4c 100644 --- a/examples/rng.rs +++ b/examples/rng.rs @@ -15,7 +15,7 @@ fn main() -> ! { let p = pac::Peripherals::take().unwrap(); let mut rng = p.RNG.init(); let val = rng.get_rand().unwrap(); - hprintln!("random value {}", val).unwrap(); + hprintln!("random value {}", val); loop { core::hint::spin_loop(); } diff --git a/examples/rtc.rs b/examples/rtc.rs index 4b4ec60..c7c5761 100644 --- a/examples/rtc.rs +++ b/examples/rtc.rs @@ -50,6 +50,6 @@ fn main() -> ! { // rtc.set_minutes(59).unwrap(); // rtc.set_seconds(59).unwrap(); loop { - hprintln!("{}", rtc.get_datetime()).unwrap(); + hprintln!("{}", rtc.get_datetime()); } } diff --git a/examples/stm32f7disco-qspi-flash/main.rs b/examples/stm32f7disco-qspi-flash/main.rs index 586b17c..ee5cecb 100644 --- a/examples/stm32f7disco-qspi-flash/main.rs +++ b/examples/stm32f7disco-qspi-flash/main.rs @@ -97,7 +97,7 @@ fn memory_example_polling(mt25q: &mut mt25q::Mt25q) { } } - hprintln!("Flash device memory test successful!").unwrap(); + hprintln!("Flash device memory test successful!"); } fn memory_example_dma( @@ -174,5 +174,5 @@ fn memory_example_dma( } } - hprintln!("Flash device memory DMA test successful!").unwrap(); + hprintln!("Flash device memory DMA test successful!"); } diff --git a/examples/timer-periph.rs b/examples/timer-periph.rs index cd7e8aa..ca331dd 100644 --- a/examples/timer-periph.rs +++ b/examples/timer-periph.rs @@ -30,15 +30,15 @@ fn main() -> ! { let mut timer = dp.TIM1.counter_ms(&clocks); timer.start(1.secs()).unwrap(); - hprintln!("hello!").unwrap(); + hprintln!("hello!"); // wait until timer expires nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 1").unwrap(); + hprintln!("timer expired 1"); // the function counter_ms() creates a periodic timer, so it is automatically // restarted nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 2").unwrap(); + hprintln!("timer expired 2"); // cancel current timer timer.cancel().unwrap(); @@ -46,16 +46,16 @@ fn main() -> ! { // start it again timer.start(1.secs()).unwrap(); nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 3").unwrap(); + hprintln!("timer expired 3"); timer.cancel().unwrap(); let cancel_outcome = timer.cancel(); assert_eq!(cancel_outcome, Err(Error::Disabled)); - hprintln!("ehy, you cannot cancel a timer two times!").unwrap(); + hprintln!("ehy, you cannot cancel a timer two times!"); // this time the timer was not restarted, therefore this function should // wait forever nb::block!(timer.wait()).unwrap(); // you should never see this print - hprintln!("if you see this there is something wrong").unwrap(); + hprintln!("if you see this there is something wrong"); panic!(); } diff --git a/examples/timer-syst.rs b/examples/timer-syst.rs index 06d18eb..ed076a8 100644 --- a/examples/timer-syst.rs +++ b/examples/timer-syst.rs @@ -31,15 +31,15 @@ fn main() -> ! { let mut timer = cp.SYST.counter_us(&clocks); timer.start(42.millis()).unwrap(); - hprintln!("hello!").unwrap(); + hprintln!("hello!"); // wait until timer expires nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 1").unwrap(); + hprintln!("timer expired 1"); // the function syst() creates a periodic timer, so it is automatically // restarted nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 2").unwrap(); + hprintln!("timer expired 2"); // cancel current timer timer.cancel().unwrap(); @@ -47,16 +47,16 @@ fn main() -> ! { // start it again timer.start(42.millis()).unwrap(); nb::block!(timer.wait()).unwrap(); - hprintln!("timer expired 3").unwrap(); + hprintln!("timer expired 3"); timer.cancel().unwrap(); let cancel_outcome = timer.cancel(); assert_eq!(cancel_outcome, Err(Error::Disabled)); - hprintln!("ehy, you cannot cancel a timer two times!").unwrap(); + hprintln!("ehy, you cannot cancel a timer two times!"); // this time the timer was not restarted, therefore this function should // wait forever nb::block!(timer.wait()).unwrap(); // you should never see this print - hprintln!("if you see this there is something wrong").unwrap(); + hprintln!("if you see this there is something wrong"); panic!(); }