summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/mphalport.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-07 13:58:25 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-07 13:58:25 +1100
commita2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d (patch)
tree6a07a359d88479e774b0df94545ec52a3feccfe8 /stmhal/mphalport.c
parente3d29996b3d0b1a81bd3dcc1d139e0a6ee233b03 (diff)
downloadmicropython-a2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d.tar.gz
micropython-a2bfcbe029a4c0d47efe5b1b51d4cd2c010f748d.zip
stmhal: Use mp_raise_OSError helper function.
Diffstat (limited to 'stmhal/mphalport.c')
-rw-r--r--stmhal/mphalport.c3
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) {