summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/mpconfigport.h
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-04-11 00:12:20 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-04-11 00:12:20 +0300
commit605ff91efdeb3cd7e4948c0398c839a9ae06044a (patch)
tree1772f83cc46dff962ad5d3be7e1777db2e5c8e0f /esp8266/mpconfigport.h
parent79ce6649524b08732e15d86c4ff61266c3ec14ed (diff)
downloadmicropython-605ff91efdeb3cd7e4948c0398c839a9ae06044a.tar.gz
micropython-605ff91efdeb3cd7e4948c0398c839a9ae06044a.zip
extmod/machine_signal: Support all Pin's arguments to the constructor.
This implements the orginal idea is that Signal is a subclass of Pin, and thus can accept all the same argument as Pin, and additionally, "inverted" param. On the practical side, it allows to avoid many enclosed parenses for a typical declararion, e.g. for Zephyr: Signal(Pin(("GPIO_0", 1))). Of course, passing a Pin to Signal constructor is still supported and is the most generic form (e.g. Unix port will only support such form, as it doesn't have "builtin" Pins), what's introduces here is just practical readability optimization. "value" kwarg is treated as applying to a Signal (i.e. accounts for possible inversion).
Diffstat (limited to 'esp8266/mpconfigport.h')
-rw-r--r--esp8266/mpconfigport.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h
index b25bb8bb45..d0b4a7b4b9 100644
--- a/esp8266/mpconfigport.h
+++ b/esp8266/mpconfigport.h
@@ -73,6 +73,7 @@
#define MICROPY_PY_UZLIB (1)
#define MICROPY_PY_LWIP (1)
#define MICROPY_PY_MACHINE (1)
+#define MICROPY_PY_MACHINE_PIN_MAKE_NEW mp_pin_make_new
#define MICROPY_PY_MACHINE_PULSE (1)
#define MICROPY_PY_MACHINE_I2C (1)
#define MICROPY_PY_MACHINE_SPI (1)