Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
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
micropython
Commits
75af908c
Commit
75af908c
authored
Oct 07, 2016
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extmod: Use mp_raise_OSError helper function.
parent
06d00834
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
extmod/machine_pulse.c
extmod/machine_pulse.c
+1
-1
extmod/modbtree.c
extmod/modbtree.c
+2
-2
extmod/modussl_axtls.c
extmod/modussl_axtls.c
+2
-2
extmod/modussl_mbedtls.c
extmod/modussl_mbedtls.c
+1
-1
extmod/moduzlib.c
extmod/moduzlib.c
+1
-1
No files found.
extmod/machine_pulse.c
View file @
75af908c
...
...
@@ -58,7 +58,7 @@ STATIC mp_obj_t machine_time_pulse_us_(size_t n_args, const mp_obj_t *args) {
}
mp_uint_t
us
=
machine_time_pulse_us
(
pin
,
level
,
timeout_us
);
if
(
us
==
(
mp_uint_t
)
-
1
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
MP_ETIMEDOUT
))
);
mp_raise_OSError
(
MP_ETIMEDOUT
);
}
return
mp_obj_new_int
(
us
);
}
...
...
extmod/modbtree.c
View file @
75af908c
...
...
@@ -58,7 +58,7 @@ STATIC const mp_obj_type_t btree_type;
#define CHECK_ERROR(res) \
if (res == RET_ERROR) { \
nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(errno))
); \
mp_raise_OSError(errno
); \
}
void
__dbpanic
(
DB
*
db
)
{
...
...
@@ -370,7 +370,7 @@ STATIC mp_obj_t mod_btree_open(size_t n_args, const mp_obj_t *pos_args, mp_map_t
DB
*
db
=
__bt_open
(
pos_args
[
0
],
&
btree_stream_fvtable
,
&
openinfo
,
/*dflags*/
0
);
if
(
db
==
NULL
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
errno
))
);
mp_raise_OSError
(
errno
);
}
return
MP_OBJ_FROM_PTR
(
btree_new
(
db
));
}
...
...
extmod/modussl_axtls.c
View file @
75af908c
...
...
@@ -56,7 +56,7 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, bool server_side) {
uint32_t
options
=
SSL_SERVER_VERIFY_LATER
;
if
((
o
->
ssl_ctx
=
ssl_ctx_new
(
options
,
SSL_DEFAULT_CLNT_SESS
))
==
NULL
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
EINVAL
))
);
mp_raise_OSError
(
MP_EINVAL
);
}
if
(
server_side
)
{
...
...
@@ -69,7 +69,7 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, bool server_side) {
if
((
res
=
ssl_handshake_status
(
o
->
ssl_sock
))
!=
SSL_OK
)
{
printf
(
"ssl_handshake_status: %d
\n
"
,
res
);
ssl_display_error
(
res
);
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
EIO
))
);
mp_raise_OSError
(
MP_EIO
);
}
}
...
...
extmod/modussl_mbedtls.c
View file @
75af908c
...
...
@@ -179,7 +179,7 @@ STATIC mp_obj_ssl_socket_t *socket_new(mp_obj_t sock, struct ssl_args *args) {
if
(
ret
!=
MBEDTLS_ERR_SSL_WANT_READ
&&
ret
!=
MBEDTLS_ERR_SSL_WANT_WRITE
)
{
//assert(0);
printf
(
"mbedtls_ssl_handshake error: -%x
\n
"
,
-
ret
);
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
EIO
))
);
mp_raise_OSError
(
MP_EIO
);
}
}
}
...
...
extmod/moduzlib.c
View file @
75af908c
...
...
@@ -59,7 +59,7 @@ STATIC unsigned char read_src_stream(TINF_DATA *data) {
byte
c
;
mp_uint_t
out_sz
=
stream
->
read
(
self
->
src_stream
,
&
c
,
1
,
&
err
);
if
(
out_sz
==
MP_STREAM_ERROR
)
{
nlr_raise
(
mp_obj_new_exception_arg1
(
&
mp_type_OSError
,
MP_OBJ_NEW_SMALL_INT
(
err
))
);
mp_raise_OSError
(
err
);
}
if
(
out_sz
==
0
)
{
nlr_raise
(
mp_obj_new_exception
(
&
mp_type_EOFError
));
...
...
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