Skip to content

Commit 0b81e79

Browse files
Change DefaultIrqHandler to spin, not panic.
Also it doesn't need to be unsafe.
1 parent e2b3113 commit 0b81e79

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

rp235x-hal/src/arch.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -473,16 +473,15 @@ mod inner {
473473

474474
/// Our default IRQ handler.
475475
///
476-
/// Just panics.
477-
///
478-
/// # Safety
479-
///
480-
/// Do not call this function - it is called automatically when our
481-
/// `MachineExternal` interrupt handler can't find anything better to call.
476+
/// Just spins.
482477
#[no_mangle]
483478
#[allow(non_snake_case)]
484-
unsafe fn DefaultIrqHandler() {
485-
panic!();
479+
fn DefaultIrqHandler() {
480+
// Spin, so you can attach a debugger if you get stuck here.
481+
// This is the also the default functionality used in cortex-m-rt.
482+
loop {
483+
crate::arch::nop();
484+
}
486485
}
487486
}
488487

0 commit comments

Comments
 (0)