From e9b8a06a2e7faa552fa5463aff80b3bec3a61755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvin=20=C3=85kerfeldt?= <Edvin Ã…kerfeldt> Date: Wed, 2 Dec 2020 15:54:54 +0100 Subject: [PATCH] E complete --- Cargo.toml | 4 ++-- src/main.rs | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8014173..c924495 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,8 +16,8 @@ rtt-target = { version = "0.3.0", features = ["cortex-m"] } # panic handlers panic-halt = "0.2.0" -panic-semihosting = "0.5.6" -panic-rtt-target = { version = "0.1.1", features = ["cortex-m"] } +#panic-semihosting = "0.5.6" +#panic-rtt-target = { version = "0.1.1", features = ["cortex-m"] } [dependencies.stm32f4] version = "0.12.1" diff --git a/src/main.rs b/src/main.rs index d97abfe..d1f0529 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,3 +130,15 @@ idle // // Paste the implementation here // [Your answer here] +/* +The implementation for our panic is found to be an infinite loop with a no reordering compiler fence. +This means that it is impossible for the program to leave this point in the code. This is a halt. + +#[inline(never)] +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { + loop { + atomic::compiler_fence(Ordering::SeqCst); + } +} +*/ -- GitLab