Skip to content

Commit e68811d

Browse files
committed
unix/modmachine: Enable time_pulse_us() function.
1 parent 4116755 commit e68811d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

unix/modmachine.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
#include "extmod/machine_mem.h"
3434
#include "extmod/machine_pinbase.h"
35+
#include "extmod/machine_pulse.h"
3536

3637
#if MICROPY_PLAT_DEV_MEM
3738
#include <errno.h>
@@ -81,6 +82,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
8182
{ MP_ROM_QSTR(MP_QSTR_mem32), MP_ROM_PTR(&machine_mem32_obj) },
8283

8384
{ MP_ROM_QSTR(MP_QSTR_PinBase), MP_ROM_PTR(&machine_pinbase_type) },
85+
#if MICROPY_PY_MACHINE_PULSE
86+
{ MP_ROM_QSTR(MP_QSTR_time_pulse_us), MP_ROM_PTR(&machine_time_pulse_us_obj) },
87+
#endif
8488
};
8589

8690
STATIC MP_DEFINE_CONST_DICT(machine_module_globals, machine_module_globals_table);

unix/mpconfigport.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
#define MICROPY_PY_USELECT (1)
121121
#endif
122122
#define MICROPY_PY_MACHINE (1)
123+
#define MICROPY_PY_MACHINE_PULSE (1)
123124
#define MICROPY_MACHINE_MEM_GET_READ_ADDR mod_machine_mem_get_addr
124125
#define MICROPY_MACHINE_MEM_GET_WRITE_ADDR mod_machine_mem_get_addr
125126

0 commit comments

Comments
 (0)