diff --git a/Cargo.toml b/Cargo.toml index 80141736d21cfdb6d8cbf6fafca12f3b25029317..c9244954dfb8189d3b7282aa6cbb9e827e859a18 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 d97abfe98f0ef76488291c1489260ec0b01096e0..d1f05292589e0e145832e2ced0983e88289475c8 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); + } +} +*/