Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
circuitpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
circuitpython
Commits
8bb8e97d
Commit
8bb8e97d
authored
Feb 22, 2017
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cc3200: Convert to using uPy internal errno numbers.
parent
85ab469c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
cc3200/mods/modusocket.c
cc3200/mods/modusocket.c
+3
-3
cc3200/mods/pybuart.c
cc3200/mods/pybuart.c
+3
-3
cc3200/mpconfigport.h
cc3200/mpconfigport.h
+1
-0
No files found.
cc3200/mods/modusocket.c
View file @
8bb8e97d
...
...
@@ -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
;
}
}
else
{
*
_errno
=
EINVAL
;
*
_errno
=
MP_
EINVAL
;
ret
=
MP_STREAM_ERROR
;
}
return
ret
;
...
...
@@ -519,7 +519,7 @@ STATIC mp_obj_t socket_recv(mp_obj_t self_in, mp_obj_t len_in) {
int
_errno
;
mp_int_t
ret
=
wlan_socket_recv
(
self
,
(
byte
*
)
vstr
.
buf
,
len
,
&
_errno
);
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_OSError
(
-
_errno
);
...
...
@@ -565,7 +565,7 @@ STATIC mp_obj_t socket_recvfrom(mp_obj_t self_in, mp_obj_t len_in) {
int
_errno
;
mp_int_t
ret
=
wlan_socket_recvfrom
(
self
,
(
byte
*
)
vstr
.
buf
,
vstr
.
len
,
ip
,
&
port
,
&
_errno
);
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_OSError
(
-
_errno
);
...
...
cc3200/mods/pybuart.c
View file @
8bb8e97d
...
...
@@ -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
if
(
!
uart_rx_wait
(
self
))
{
// return EAGAIN error to indicate non-blocking (then read() method returns None)
*
errcode
=
EAGAIN
;
// return
MP_
EAGAIN error to indicate non-blocking (then read() method returns None)
*
errcode
=
MP_
EAGAIN
;
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
ret
|=
MP_STREAM_POLL_WR
;
}
}
else
{
*
errcode
=
EINVAL
;
*
errcode
=
MP_
EINVAL
;
ret
=
MP_STREAM_ERROR
;
}
return
ret
;
...
...
cc3200/mpconfigport.h
View file @
8bb8e97d
...
...
@@ -75,6 +75,7 @@
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_MODULE_WEAK_LINKS (1)
#define MICROPY_CAN_OVERRIDE_BUILTINS (1)
#define MICROPY_USE_INTERNAL_ERRNO (1)
#define MICROPY_VFS (1)
#define MICROPY_VFS_FAT (1)
#define MICROPY_PY_ASYNC_AWAIT (0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment