Commit 8bb8e97d authored by Damien George's avatar Damien George
Browse files

cc3200: Convert to using uPy internal errno numbers.

parent 85ab469c
...@@ -276,7 +276,7 @@ STATIC int wlan_socket_ioctl (mod_network_socket_obj_t *s, mp_uint_t request, mp ...@@ -276,7 +276,7 @@ STATIC int wlan_socket_ioctl (mod_network_socket_obj_t *s, mp_uint_t request, mp
ret |= MP_STREAM_POLL_HUP; ret |= MP_STREAM_POLL_HUP;
} }
} else { } else {
*_errno = EINVAL; *_errno = MP_EINVAL;
ret = MP_STREAM_ERROR; ret = MP_STREAM_ERROR;
} }
return ret; return ret;
...@@ -519,7 +519,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) { ...@@ -519,7 +519,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) {
int _errno; int _errno;
mp_int_t ret = wlan_socket_recv(self, (byte*)vstr.buf, len, &_errno); mp_int_t ret = wlan_socket_recv(self, (byte*)vstr.buf, len, &_errno);
if (ret < 0) { if (ret < 0) {
if (_errno == EAGAIN && self->sock_base.has_timeout) { if (_errno == MP_EAGAIN && self->sock_base.has_timeout) {
mp_raise_msg(&mp_type_TimeoutError, "timed out"); mp_raise_msg(&mp_type_TimeoutError, "timed out");
} }
mp_raise_OSError(-_errno); mp_raise_OSError(-_errno);
...@@ -565,7 +565,7 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) { ...@@ -565,7 +565,7 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) {
int _errno; int _errno;
mp_int_t ret = wlan_socket_recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno); mp_int_t ret = wlan_socket_recvfrom(self, (byte*)vstr.buf, vstr.len, ip, &port, &_errno);
if (ret < 0) { if (ret < 0) {
if (_errno == EAGAIN && self->sock_base.has_timeout) { if (_errno == MP_EAGAIN && self->sock_base.has_timeout) {
mp_raise_msg(&mp_type_TimeoutError, "timed out"); mp_raise_msg(&mp_type_TimeoutError, "timed out");
} }
mp_raise_OSError(-_errno); mp_raise_OSError(-_errno);
......
...@@ -596,8 +596,8 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i ...@@ -596,8 +596,8 @@ STATIC mp_uint_t pyb_uart_read(mp_obj_t self_in, void *buf_in, mp_uint_t size, i
// wait for first char to become available // wait for first char to become available
if (!uart_rx_wait(self)) { if (!uart_rx_wait(self)) {
// return EAGAIN error to indicate non-blocking (then read() method returns None) // return MP_EAGAIN error to indicate non-blocking (then read() method returns None)
*errcode = EAGAIN; *errcode = MP_EAGAIN;
return MP_STREAM_ERROR; return MP_STREAM_ERROR;
} }
...@@ -639,7 +639,7 @@ STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t a ...@@ -639,7 +639,7 @@ STATIC mp_uint_t pyb_uart_ioctl(mp_obj_t self_in, mp_uint_t request, mp_uint_t a
ret |= MP_STREAM_POLL_WR; ret |= MP_STREAM_POLL_WR;
} }
} else { } else {
*errcode = EINVAL; *errcode = MP_EINVAL;
ret = MP_STREAM_ERROR; ret = MP_STREAM_ERROR;
} }
return ret; return ret;
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
#define MICROPY_STREAMS_NON_BLOCK (1) #define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_MODULE_WEAK_LINKS (1) #define MICROPY_MODULE_WEAK_LINKS (1)
#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_CAN_OVERRIDE_BUILTINS (1)
#define MICROPY_USE_INTERNAL_ERRNO (1)
#define MICROPY_VFS (1) #define MICROPY_VFS (1)
#define MICROPY_VFS_FAT (1) #define MICROPY_VFS_FAT (1)
#define MICROPY_PY_ASYNC_AWAIT (0) #define MICROPY_PY_ASYNC_AWAIT (0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment