diff options
| author | Damien George <damien@micropython.org> | 2022-07-06 21:26:42 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-07-08 23:47:29 +1000 |
| commit | 9af6a275dd2bbb8a815e27e1e61c3f4547a44da0 (patch) | |
| tree | d03715c47bdf29f1bcdbcb231d065d55e82bec1c /ports/stm32/modmachine.c | |
| parent | 9f8087b448890417d5aa86551957a2100616bb8e (diff) | |
stm32/boardctrl: Allow boards to override fatal-error handler.
To override it a board must define MICROPY_BOARD_FATAL_ERROR to a function
that takes a string message and does not return.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'ports/stm32/modmachine.c')
| -rw-r--r-- | ports/stm32/modmachine.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ports/stm32/modmachine.c b/ports/stm32/modmachine.c index 34e78d261..acedac7a5 100644 --- a/ports/stm32/modmachine.c +++ b/ports/stm32/modmachine.c @@ -339,8 +339,7 @@ STATIC mp_obj_t machine_freq(size_t n_args, const mp_obj_t *args) { if (ret == -MP_EINVAL) { mp_raise_ValueError(MP_ERROR_TEXT("invalid freq")); } else if (ret < 0) { - void NORETURN __fatal_error(const char *msg); - __fatal_error("can't change freq"); + MICROPY_BOARD_FATAL_ERROR("can't change freq"); } return mp_const_none; #endif |
