mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 15:29:28 -05:00
Add chDbgPanic for unhandled exceptions.
This commit is contained in:
parent
6101ca36cd
commit
eb294c8e1c
@ -178,9 +178,12 @@ vectors_t _vectors = {
|
|||||||
__attribute__ ((naked))
|
__attribute__ ((naked))
|
||||||
#endif
|
#endif
|
||||||
void _unhandled_exception(void) {
|
void _unhandled_exception(void) {
|
||||||
|
#if CH_DBG_ENABLED
|
||||||
|
chDbgPanic("Unhandled");
|
||||||
|
#else
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
;
|
;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void NMIVector(void) __attribute__((weak, alias("_unhandled_exception")));
|
void NMIVector(void) __attribute__((weak, alias("_unhandled_exception")));
|
||||||
|
@ -81,18 +81,27 @@ void port_halt(void) {
|
|||||||
|
|
||||||
#if defined(LPC43XX_M4)
|
#if defined(LPC43XX_M4)
|
||||||
CH_IRQ_HANDLER(MemManageVector) {
|
CH_IRQ_HANDLER(MemManageVector) {
|
||||||
CH_IRQ_PROLOGUE();
|
#if CH_DBG_ENABLED
|
||||||
|
chDbgPanic("MemManage");
|
||||||
|
#else
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CH_IRQ_HANDLER(BusFaultVector) {
|
CH_IRQ_HANDLER(BusFaultVector) {
|
||||||
CH_IRQ_PROLOGUE();
|
#if CH_DBG_ENABLED
|
||||||
|
chDbgPanic("BusFault");
|
||||||
|
#else
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
CH_IRQ_HANDLER(UsageFaultVector) {
|
CH_IRQ_HANDLER(UsageFaultVector) {
|
||||||
CH_IRQ_PROLOGUE();
|
#if CH_DBG_ENABLED
|
||||||
|
chDbgPanic("UsageFault");
|
||||||
|
#else
|
||||||
chSysHalt();
|
chSysHalt();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user