Commit 902da05a authored by Thorsten von Eicken's avatar Thorsten von Eicken Committed by Damien George

esp32: Set MICROPY_USE_INTERNAL_ERRNO=0 to use toolchain's errno.h.

The underlying OS (the ESP-IDF) uses it's own internal errno codes and so
it's simpler and cleaner to use those rather than trying to convert
everything to the values defined in py/mperrno.h.
parent 771376a0
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#define MICROPY_MODULE_FROZEN_MPY (1) #define MICROPY_MODULE_FROZEN_MPY (1)
#define MICROPY_QSTR_EXTRA_POOL mp_qstr_frozen_const_pool #define MICROPY_QSTR_EXTRA_POOL mp_qstr_frozen_const_pool
#define MICROPY_CAN_OVERRIDE_BUILTINS (1) #define MICROPY_CAN_OVERRIDE_BUILTINS (1)
#define MICROPY_USE_INTERNAL_ERRNO (1) #define MICROPY_USE_INTERNAL_ERRNO (0) // errno.h from xtensa-esp32-elf/sys-include/sys
#define MICROPY_USE_INTERNAL_PRINTF (0) // ESP32 SDK requires its own printf #define MICROPY_USE_INTERNAL_PRINTF (0) // ESP32 SDK requires its own printf
#define MICROPY_ENABLE_SCHEDULER (1) #define MICROPY_ENABLE_SCHEDULER (1)
#define MICROPY_SCHEDULER_DEPTH (8) #define MICROPY_SCHEDULER_DEPTH (8)
......
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
try: try:
import usocket as socket import usocket as socket
import uerrno as errno
except: except:
import socket import socket, errno
def test(peer_addr): def test(peer_addr):
...@@ -12,7 +13,7 @@ def test(peer_addr): ...@@ -12,7 +13,7 @@ def test(peer_addr):
try: try:
s.connect(peer_addr) s.connect(peer_addr)
except OSError as er: except OSError as er:
print(er.args[0] == 115) # 115 is EINPROGRESS print(er.args[0] == errno.EINPROGRESS)
s.close() s.close()
......
Markdown is supported
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