Skip to content
Snippets Groups Projects
Commit 33168081 authored by Damien George's avatar Damien George
Browse files

extmod/machine: Add MICROPY_PY_MACHINE_PULSE config for time_pulse_us.

Since not all ports that enable the machine module have the pin HAL
functions.
parent cff2b7a6
No related branches found
No related tags found
No related merge requests found
......@@ -59,6 +59,7 @@
#define MICROPY_PY_UZLIB (1)
#define MICROPY_PY_LWIP (1)
#define MICROPY_PY_MACHINE (1)
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_WEBSOCKET (1)
#define MICROPY_PY_WEBREPL (1)
......
......@@ -28,7 +28,7 @@
#include "py/mperrno.h"
#include "extmod/machine_pulse.h"
#if MICROPY_PY_MACHINE
#if MICROPY_PY_MACHINE_PULSE
mp_uint_t machine_time_pulse_us(mp_hal_pin_obj_t pin, int pulse_level, mp_uint_t timeout_us) {
mp_uint_t start = mp_hal_ticks_us();
......
......@@ -867,6 +867,11 @@ typedef double mp_float_t;
#define MICROPY_PY_MACHINE (0)
#endif
// Whether to include: time_pulse_us
#ifndef MICROPY_PY_MACHINE_PULSE
#define MICROPY_PY_MACHINE_PULSE (0)
#endif
#ifndef MICROPY_PY_MACHINE_I2C
#define MICROPY_PY_MACHINE_I2C (0)
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment