diff options
| author | Damien George <damien.p.george@gmail.com> | 2017-02-22 12:36:23 +1100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2017-02-22 12:58:11 +1100 |
| commit | 22a6344ebe032e9e66024614ecbe7d9608fa9288 (patch) | |
| tree | 7711a540d7bb90914336dcc77fbde28092b7bc75 /cc3200/mods/pybuart.c | |
| parent | 8bb8e97dfe2626b97028f1dad76cdd4050757961 (diff) | |
cc3200: When raising OSError's use MP_Exxx as arg instead of a string.
Diffstat (limited to 'cc3200/mods/pybuart.c')
| -rw-r--r-- | cc3200/mods/pybuart.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cc3200/mods/pybuart.c b/cc3200/mods/pybuart.c index f28af9063..bab2b3d22 100644 --- a/cc3200/mods/pybuart.c +++ b/cc3200/mods/pybuart.c @@ -279,7 +279,7 @@ STATIC void UARTGenericIntHandler(uint32_t uart_id) { STATIC void uart_check_init(pyb_uart_obj_t *self) { // not initialized if (!self->baudrate) { - mp_raise_msg(&mp_type_OSError, mpexception_os_request_not_possible); + mp_raise_OSError(MP_EPERM); } } @@ -471,7 +471,7 @@ STATIC mp_obj_t pyb_uart_make_new(const mp_obj_type_t *type, size_t n_args, size } if (uart_id > PYB_UART_1) { - mp_raise_msg(&mp_type_OSError, mpexception_os_resource_not_avaliable); + mp_raise_OSError(MP_ENODEV); } // get the correct uart instance @@ -619,7 +619,7 @@ STATIC mp_uint_t pyb_uart_write(mp_obj_t self_in, const void *buf_in, mp_uint_t // write the data if (!uart_tx_strn(self, buf, size)) { - mp_raise_msg(&mp_type_OSError, mpexception_os_operation_failed); + mp_raise_OSError(MP_EIO); } return size; } |
