Skip to content

Commit 59e5b64

Browse files
Extra clarification in abt-exception.
1 parent 2c603d9 commit 59e5b64

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

examples/versatileab/src/bin/abt-exception.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ unsafe extern "C" fn _abort_handler(_addr: u32) {
7878
println!("DFAR (Faulting Address Register): {:?}", dfar);
7979
enable_alignment_check();
8080
// For the first iteration, we do a regular exception return, which should
81-
// trigger the exception again.
82-
let counter_val = COUNTER.fetch_add(1, core::sync::atomic::Ordering::Relaxed) + 1;
83-
if counter_val == 2 {
81+
// trigger the exception again. The second time around we quit.
82+
if COUNTER.fetch_add(1, core::sync::atomic::Ordering::Relaxed) == 1 {
8483
semihosting::process::exit(0);
8584
}
8685
}

0 commit comments

Comments
 (0)