unix/modmachine: Enable time_pulse_us() function.

This commit is contained in:
Paul Sokolovsky 2016-06-19 00:21:17 +03:00
parent 41167554e4
commit e68811dbbf
2 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@
#include "extmod/machine_mem.h" #include "extmod/machine_mem.h"
#include "extmod/machine_pinbase.h" #include "extmod/machine_pinbase.h"
#include "extmod/machine_pulse.h"
#if MICROPY_PLAT_DEV_MEM #if MICROPY_PLAT_DEV_MEM
#include <errno.h> #include <errno.h>
@ -81,6 +82,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR_mem32), MP_ROM_PTR(&machine_mem32_obj) }, { MP_ROM_QSTR(MP_QSTR_mem32), MP_ROM_PTR(&machine_mem32_obj) },
{ MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) }, { MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) },
#if MICROPY_PY_MACHINE_PULSE
{ MP_ROM_QSTR(MP_QSTR_time_pulse_us), MP_ROM_PTR(&machine_time_pulse_us_obj) },
#endif
}; };
STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table); STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table);

View File

@ -120,6 +120,7 @@
#define MICROPY_PY_USELECT (1) #define MICROPY_PY_USELECT (1)
#endif #endif
#define MICROPY_PY_MACHINE (1) #define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_MACHINE_MEM_GET_READ_ADDR mod_machine_mem_get_addr #define MICROPY_MACHINE_MEM_GET_READ_ADDR mod_machine_mem_get_addr
#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR mod_machine_mem_get_addr #define MICROPY_MACHINE_MEM_GET_WRITE_ADDR mod_machine_mem_get_addr