1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/cortexm_common: allow to overwrite nmi_handler

If a user wants to handle NMI events, let them do so by
providing an implementation for nmi_handler() instead of
paniking.
This commit is contained in:
Benjamin Valentin 2022-06-20 18:22:22 +02:00
parent 1638606c5c
commit 8cf20a286d
2 changed files with 4 additions and 3 deletions

View File

@ -80,7 +80,7 @@ void reset_handler_default(void);
* and can not be masked (surprise surprise...). They can be triggered by
* software and some peripherals. So far, they are not used in RIOT.
*/
void nmi_default(void);
void nmi_handler(void);
/**
* @brief Hard fault exception handler

View File

@ -209,7 +209,8 @@ void reset_handler_default(void)
kernel_init();
}
void nmi_default(void)
__attribute__((weak))
void nmi_handler(void)
{
core_panic(PANIC_NMI_HANDLER, "NMI HANDLER");
}
@ -505,7 +506,7 @@ ISR_VECTOR(0) const cortexm_base_t cortex_vector_base = {
/* entry point of the program */
[ 0] = reset_handler_default,
/* [-14] non maskable interrupt handler */
[ 1] = nmi_default,
[ 1] = nmi_handler,
/* [-13] hard fault exception */
[ 2] = hard_fault_default,
/* [-5] SW interrupt, in RIOT used for triggering context switches */