Skip to content
Snippets Groups Projects
Commit 2d11b174 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/moduselect: Make configurable with MICROPY_PY_USELECT.

parent f9251659
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,10 @@ ...@@ -25,6 +25,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "py/mpconfig.h"
#if MICROPY_PY_USELECT
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <poll.h> #include <poll.h>
...@@ -212,3 +216,5 @@ const mp_obj_module_t mp_module_uselect = { ...@@ -212,3 +216,5 @@ const mp_obj_module_t mp_module_uselect = {
.name = MP_QSTR_uselect, .name = MP_QSTR_uselect,
.globals = (mp_obj_dict_t*)&mp_module_select_globals, .globals = (mp_obj_dict_t*)&mp_module_select_globals,
}; };
#endif // MICROPY_PY_USELECT
...@@ -104,6 +104,9 @@ ...@@ -104,6 +104,9 @@
#define MICROPY_PY_UHEAPQ (1) #define MICROPY_PY_UHEAPQ (1)
#define MICROPY_PY_UHASHLIB (1) #define MICROPY_PY_UHASHLIB (1)
#define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UBINASCII (1)
#ifndef MICROPY_PY_USELECT
#define MICROPY_PY_USELECT (1)
#endif
#define MICROPY_PY_MACHINE (1) #define MICROPY_PY_MACHINE (1)
// Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc. // Define to MICROPY_ERROR_REPORTING_DETAILED to get function, etc.
...@@ -158,6 +161,11 @@ extern const struct _mp_obj_module_t mp_module_jni; ...@@ -158,6 +161,11 @@ extern const struct _mp_obj_module_t mp_module_jni;
#else #else
#define MICROPY_PY_SOCKET_DEF #define MICROPY_PY_SOCKET_DEF
#endif #endif
#if MICROPY_PY_USELECT
#define MICROPY_PY_USELECT_DEF { MP_ROM_QSTR(MP_QSTR_uselect), MP_ROM_PTR(&mp_module_uselect) },
#else
#define MICROPY_PY_USELECT_DEF
#endif
#define MICROPY_PORT_BUILTIN_MODULES \ #define MICROPY_PORT_BUILTIN_MODULES \
MICROPY_PY_FFI_DEF \ MICROPY_PY_FFI_DEF \
...@@ -166,7 +174,7 @@ extern const struct _mp_obj_module_t mp_module_jni; ...@@ -166,7 +174,7 @@ extern const struct _mp_obj_module_t mp_module_jni;
MICROPY_PY_SOCKET_DEF \ MICROPY_PY_SOCKET_DEF \
{ MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&mp_module_machine) }, \ { MP_ROM_QSTR(MP_QSTR_machine), MP_ROM_PTR(&mp_module_machine) }, \
{ MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) }, \ { MP_ROM_QSTR(MP_QSTR_uos), MP_ROM_PTR(&mp_module_os) }, \
{ MP_ROM_QSTR(MP_QSTR_uselect), MP_ROM_PTR(&mp_module_uselect) }, \ MICROPY_PY_USELECT_DEF \
MICROPY_PY_TERMIOS_DEF \ MICROPY_PY_TERMIOS_DEF \
// type definitions for the specific machine // type definitions for the specific machine
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment