summaryrefslogtreecommitdiff
path: root/cc3200/mods/pybi2c.c
diff options
context:
space:
mode:
authorTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
committerTony DiCola <tony@tonydicola.com>2016-10-20 23:01:13 +0000
commit00a44fa36cd1e35a438c4b89b5cef0bc82787c7a (patch)
tree4800a6984902e043e3fc437adcdfcd665f83e220 /cc3200/mods/pybi2c.c
parent1f13f870b8f6554d9cd5570de221a6886e065b64 (diff)
parent3967ca7390ff8257728ef6237b93977b63bde41d (diff)
Merge remote-tracking branch 'micropython/master'
Conflicts: README.md - Kept Adafruit README.md intact. py/emitglue.c - Added xtensa architecture as an OR of the define. zephyr/README.md - Fixed spelling mistake.
Diffstat (limited to 'cc3200/mods/pybi2c.c')
-rw-r--r--cc3200/mods/pybi2c.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/cc3200/mods/pybi2c.c b/cc3200/mods/pybi2c.c
index 5022e614f..d92782d8a 100644
--- a/cc3200/mods/pybi2c.c
+++ b/cc3200/mods/pybi2c.c
@@ -144,7 +144,7 @@ STATIC bool pyb_i2c_transaction(uint cmd) {
STATIC void pyb_i2c_check_init(pyb_i2c_obj_t *self) {
// not initialized
if (!self->baudrate) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_request_not_possible));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_request_not_possible);
}
}
@@ -256,7 +256,7 @@ STATIC void pyb_i2c_read_into (mp_arg_val_t *args, vstr_t *vstr) {
// receive the data
if (!pyb_i2c_read(args[0].u_int, (byte *)vstr->buf, vstr->len)) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed);
}
}
@@ -275,7 +275,7 @@ STATIC void pyb_i2c_readmem_into (mp_arg_val_t *args, vstr_t *vstr) {
if (pyb_i2c_mem_addr_write (i2c_addr, (byte *)&mem_addr, mem_addr_size)) {
// Read the specified length of data
if (!pyb_i2c_read (i2c_addr, (byte *)vstr->buf, vstr->len)) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed);
}
}
}
@@ -323,7 +323,7 @@ STATIC mp_obj_t pyb_i2c_init_helper(pyb_i2c_obj_t *self, const mp_arg_val_t *arg
return mp_const_none;
invalid_args:
- nlr_raise(mp_obj_new_exception_msg(&mp_type_ValueError, mpexception_value_invalid_arguments));
+ mp_raise_ValueError(mpexception_value_invalid_arguments);
}
STATIC const mp_arg_t pyb_i2c_init_args[] = {
@@ -341,7 +341,7 @@ STATIC mp_obj_t pyb_i2c_make_new(const mp_obj_type_t *type, mp_uint_t n_args, mp
// check the peripheral id
if (args[0].u_int != 0) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable);
}
// setup the object
@@ -445,7 +445,7 @@ STATIC mp_obj_t pyb_i2c_writeto(mp_uint_t n_args, const mp_obj_t *pos_args, mp_m
// send the data
if (!pyb_i2c_write(args[0].u_int, bufinfo.buf, bufinfo.len, args[2].u_bool)) {
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed);
}
// return the number of bytes written
@@ -514,7 +514,7 @@ STATIC mp_obj_t pyb_i2c_writeto_mem(mp_uint_t n_args, const mp_obj_t *pos_args,
return mp_obj_new_int(bufinfo.len);
}
- nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, mpexception_os_operation_failed));
+ mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed);
}
STATIC MP_DEFINE_CONST_FUN_OBJ_KW(pyb_i2c_writeto_mem_obj, 1, pyb_i2c_writeto_mem);