diff options
Diffstat (limited to 'stmhal/mphalport.c')
-rw-r--r-- | stmhal/mphalport.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/stmhal/mphalport.c b/stmhal/mphalport.c index cea0369213..f392550b80 100644 --- a/stmhal/mphalport.c +++ b/stmhal/mphalport.c @@ -1,6 +1,7 @@ #include <string.h> #include "py/mpstate.h" +#include "py/runtime.h" #include "py/mperrno.h" #include "py/mphal.h" #include "usb.h" @@ -15,7 +16,7 @@ const byte mp_hal_status_to_errno_table[4] = { }; NORETURN void mp_hal_raise(HAL_StatusTypeDef status) { - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(mp_hal_status_to_errno_table[status]))); + mp_raise_OSError(mp_hal_status_to_errno_table[status]); } void mp_hal_set_interrupt_char(int c) { |