Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit c1982fa

Browse files
author
iwahdan88
committed
Adding IDF error codes to MP err code tables (WIP)
1 parent 0aec2de commit c1982fa

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

esp32/mpconfigport.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,33 @@ extern const struct _mp_obj_module_t mp_module_uqueue;
268268

269269
#define _assert(expr) ((expr) ? (void)0 : __assert_func(__FILE__, __LINE__, __func__, #expr))
270270

271+
#define MICROPY_PY_UERRNO_LIST \
272+
X(EPERM) \
273+
X(ENOENT) \
274+
X(EIO) \
275+
X(EBADF) \
276+
X(EAGAIN) \
277+
X(ENOMEM) \
278+
X(EACCES) \
279+
X(EEXIST) \
280+
X(ENODEV) \
281+
X(EISDIR) \
282+
X(EINVAL) \
283+
X(EMSGSIZE) \
284+
X(EOPNOTSUPP) \
285+
X(EADDRINUSE) \
286+
X(ENETDOWN) \
287+
X(ECONNABORTED) \
288+
X(ECONNRESET) \
289+
X(ENOBUFS) \
290+
X(ENOTCONN) \
291+
X(ETIMEDOUT) \
292+
X(ECONNREFUSED) \
293+
X(EHOSTUNREACH) \
294+
X(EALREADY) \
295+
X(EINPROGRESS) \
296+
X(MBEDTLS_ERR_SSL_TIMEOUT) \
297+
271298
#include "mpconfigboard.h"
272299

273300
#endif // __INCLUDED_MPCONFIGPORT_H

esp32/qstrdefsport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ Q(/)
1212
// entries for sys.path
1313
Q(/flash)
1414
Q(/flash/lib)
15+
Q(MBEDTLS_ERR_SSL_TIMEOUT)

py/moduerrno.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "py/obj.h"
3131
#include "py/mperrno.h"
32+
#include "mbedtls/net_sockets.h"
3233

3334
#if MICROPY_PY_UERRNO
3435

py/mperrno.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@
142142
#define MP_EHOSTUNREACH EHOSTUNREACH
143143
#define MP_EALREADY EALREADY
144144
#define MP_EINPROGRESS EINPROGRESS
145+
#define MP_MBEDTLS_ERR_SSL_TIMEOUT MBEDTLS_ERR_SSL_TIMEOUT
146+
#define MP_MBEDTLS_ERR_NET_SOCKET_FAILED MBEDTLS_ERR_NET_SOCKET_FAILED
147+
#define MP_MBEDTLS_ERR_NET_CONNECT_FAILED MBEDTLS_ERR_NET_CONNECT_FAILED
148+
#define MP_MBEDTLS_ERR_NET_BIND_FAILED MBEDTLS_ERR_NET_BIND_FAILED
145149

146150
#endif
147151

0 commit comments

Comments
 (0)