summaryrefslogtreecommitdiffstatshomepage
path: root/cc3200/mods/pybsd.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-22 12:36:23 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-22 12:58:11 +1100
commit22a6344ebe032e9e66024614ecbe7d9608fa9288 (patch)
tree7711a540d7bb90914336dcc77fbde28092b7bc75 /cc3200/mods/pybsd.c
parent8bb8e97dfe2626b97028f1dad76cdd4050757961 (diff)
downloadmicropython-22a6344ebe032e9e66024614ecbe7d9608fa9288.tar.gz
micropython-22a6344ebe032e9e66024614ecbe7d9608fa9288.zip
cc3200: When raising OSError's use MP_Exxx as arg instead of a string.
Diffstat (limited to 'cc3200/mods/pybsd.c')
-rw-r--r--cc3200/mods/pybsd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cc3200/mods/pybsd.c b/cc3200/mods/pybsd.c
index 937b8599dc..306baea8ba 100644
--- a/cc3200/mods/pybsd.c
+++ b/cc3200/mods/pybsd.c
@@ -27,6 +27,7 @@
#include "py/mpconfig.h"
#include "py/obj.h"
#include "py/runtime.h"
+#include "py/mperrno.h"
#include "lib/oofatfs/ff.h"
#include "lib/oofatfs/diskio.h"
#include "extmod/vfs_fat.h"
@@ -108,7 +109,7 @@ STATIC mp_obj_t pyb_sd_init_helper (pybsd_obj_t *self, const mp_arg_val_t *args)
pyb_sd_hw_init (self);
if (sd_disk_init() != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed);
+ mp_raise_OSError(MP_EIO);
}
// register it with the sleep module
@@ -133,7 +134,7 @@ STATIC mp_obj_t pyb_sd_make_new(const mp_obj_type_t *type, size_t n_args, size_t
// check the peripheral id
if (args[0].u_int != 0) {
- mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
+ mp_raise_OSError(MP_ENODEV);
}
// setup and initialize the object