Skip to content

Commit

Permalink
Merge pull request #18232 from benpicco/nmi_handler
Browse files Browse the repository at this point in the history
cpu/cortexm_common: allow to overwrite nmi_handler
  • Loading branch information
benpicco authored Jun 21, 2022
2 parents 24103ad + 8cf20a2 commit 1fba8d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cpu/cortexm_common/include/vectors_cortexm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions cpu/cortexm_common/vectors_cortexm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 1fba8d3

Please sign in to comment.