panic.rs 771 B

12345678910111213141516171819202122232425262728
  1. //! Changing the panicking behavior
  2. //!
  3. //! The easiest way to change the panicking behavior is to use a different [panic handler crate][0].
  4. //!
  5. //! [0]: https://crates.io/keywords/panic-impl
  6. #![no_main]
  7. #![no_std]
  8. // Pick one of these panic handlers:
  9. // `panic!` halts execution; the panic message is ignored
  10. use panic_halt as _;
  11. // Reports panic messages to the host stderr using semihosting
  12. // NOTE to use this you need to uncomment the `panic-semihosting` dependency in Cargo.toml
  13. // use panic_semihosting as _;
  14. // Logs panic messages using the ITM (Instrumentation Trace Macrocell)
  15. // NOTE to use this you need to uncomment the `panic-itm` dependency in Cargo.toml
  16. // use panic_itm as _;
  17. use cortex_m_rt::entry;
  18. #[entry]
  19. fn main() -> ! {
  20. panic!("Oops")
  21. }