Commit dde9abad authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

esp8266/moduos: Add dupterm_notify() function.

Should be called to notify that current dupterm object has more input
data to read.
parent 7d570379
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
#include "py/runtime.h" #include "py/runtime.h"
#include "extmod/misc.h" #include "extmod/misc.h"
#include "genhdr/mpversion.h" #include "genhdr/mpversion.h"
#include "etshal.h" #include "esp_mphal.h"
#include "user_interface.h" #include "user_interface.h"
extern const mp_obj_type_t mp_fat_vfs_type; extern const mp_obj_type_t mp_fat_vfs_type;
...@@ -110,12 +110,20 @@ STATIC mp_obj_t os_urandom(mp_obj_t num) { ...@@ -110,12 +110,20 @@ STATIC mp_obj_t os_urandom(mp_obj_t num) {
} }
STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_urandom_obj, os_urandom); STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_urandom_obj, os_urandom);
STATIC mp_obj_t os_dupterm_notify(mp_obj_t obj_in) {
(void)obj_in;
mp_hal_signal_dupterm_input();
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(os_dupterm_notify_obj, os_dupterm_notify);
STATIC const mp_rom_map_elem_t os_module_globals_table[] = { STATIC const mp_rom_map_elem_t os_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uos) }, { MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_uos) },
{ MP_ROM_QSTR(MP_QSTR_uname), MP_ROM_PTR(&os_uname_obj) }, { MP_ROM_QSTR(MP_QSTR_uname), MP_ROM_PTR(&os_uname_obj) },
{ MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&os_urandom_obj) }, { MP_ROM_QSTR(MP_QSTR_urandom), MP_ROM_PTR(&os_urandom_obj) },
#if MICROPY_PY_OS_DUPTERM #if MICROPY_PY_OS_DUPTERM
{ MP_ROM_QSTR(MP_QSTR_dupterm), MP_ROM_PTR(&mp_uos_dupterm_obj) }, { MP_ROM_QSTR(MP_QSTR_dupterm), MP_ROM_PTR(&mp_uos_dupterm_obj) },
{ MP_ROM_QSTR(MP_QSTR_dupterm_notify), MP_ROM_PTR(&os_dupterm_notify_obj) },
#endif #endif
#if MICROPY_VFS_FAT #if MICROPY_VFS_FAT
{ MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) }, { MP_ROM_QSTR(MP_QSTR_VfsFat), MP_ROM_PTR(&mp_fat_vfs_type) },
......
Supports Markdown
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