summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/machine_uart.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-06-15 11:54:41 +1000
committerDamien George <damien.p.george@gmail.com>2017-06-15 11:54:41 +1000
commit48d867b4a68e53901aac87c2ff0f2a7e65f735c7 (patch)
tree178bfc0dc13bcb3b9d77c8a99652e9a9dc057e7d /esp8266/machine_uart.c
parent1e70fda69fcb4991eb60ed43e610f664ea1319e6 (diff)
downloadmicropython-48d867b4a68e53901aac87c2ff0f2a7e65f735c7.tar.gz
micropython-48d867b4a68e53901aac87c2ff0f2a7e65f735c7.zip
all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers.
Diffstat (limited to 'esp8266/machine_uart.c')
-rw-r--r--esp8266/machine_uart.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/esp8266/machine_uart.c b/esp8266/machine_uart.c
index 4d9f343db1..e8be5e538c 100644
--- a/esp8266/machine_uart.c
+++ b/esp8266/machine_uart.c
@@ -104,7 +104,7 @@ STATIC void pyb_uart_init_helper(pyb_uart_obj_t *self, size_t n_args, const mp_o
self->bits = 8;
break;
default:
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "invalid data bits"));
+ mp_raise_ValueError("invalid data bits");
break;
}
@@ -140,7 +140,7 @@ STATIC void pyb_uart_init_helper(pyb_uart_obj_t *self, size_t n_args, const mp_o
self->stop = 2;
break;
default:
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_ValueError, "invalid stop bits"));
+ mp_raise_ValueError("invalid stop bits");
break;
}
@@ -215,7 +215,7 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
pyb_uart_obj_t *self = MP_OBJ_TO_PTR(self_in);
if (self->uart_id == 1) {
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_OSError, "UART(1) can't read"));
+ mp_raise_msg(&mp_type_OSError, "UART(1) can't read");
}
// make sure we want at least 1 char