summaryrefslogtreecommitdiff
path: root/stmhal/mphal.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-11-15 20:39:44 +0000
committerDamien George <damien.p.george@gmail.com>2014-11-15 20:39:44 +0000
commit224fee0e1080fa7cd654de240c32c8433bb07cf9 (patch)
treeacec380a63a2fe5bb6e8e33aa899749e39fba94f /stmhal/mphal.c
parentaec189a5ba4e1feac82625507851d4188f6dd510 (diff)
stmhal: Fix HAL error raising; make test for it.
Addresses issue #968.
Diffstat (limited to 'stmhal/mphal.c')
-rw-r--r--stmhal/mphal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stmhal/mphal.c b/stmhal/mphal.c
index e8f242051..7fcd982dc 100644
--- a/stmhal/mphal.c
+++ b/stmhal/mphal.c
@@ -16,5 +16,5 @@ 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_t)(mp_uint_t)mp_hal_status_to_errno_table[status]));
+ nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(mp_hal_status_to_errno_table[status])));
}