diff options
| author | Elvis Pfützenreuter <epxx@epxx.co> | 2019-05-15 23:29:34 -0300 |
|---|---|---|
| committer | Elvis Pfutzenreuter <epxx@epxx.co> | 2019-06-04 18:05:46 -0300 |
| commit | 1da8d4b4da7b71a68d367601e10b4633606fab56 (patch) | |
| tree | d483f73fe18b5e1c5415d7528859d4697bc7cb99 /py | |
| parent | c5a4e19d6f76a09cba73149d5e3d4548da320899 (diff) | |
Add PS/2 support -- ps2io module
Diffstat (limited to 'py')
| -rw-r--r-- | py/circuitpy_defns.mk | 5 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.h | 8 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.mk | 6 |
3 files changed, 19 insertions, 0 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 1aca33901..722f06e93 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -162,6 +162,9 @@ endif ifeq ($(CIRCUITPY_PULSEIO),1) SRC_PATTERNS += pulseio/% endif +ifeq ($(CIRCUITPY_PS2IO),1) +SRC_PATTERNS += ps2io/% +endif ifeq ($(CIRCUITPY_RANDOM),1) SRC_PATTERNS += random/% endif @@ -252,6 +255,8 @@ $(filter $(SRC_PATTERNS), \ pulseio/PulseIn.c \ pulseio/PulseOut.c \ pulseio/__init__.c \ + ps2io/Ps2.c \ + ps2io/__init__.c \ rotaryio/IncrementalEncoder.c \ rotaryio/__init__.c \ rtc/RTC.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 0575bcfe0..c794759f8 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -416,6 +416,13 @@ extern const struct _mp_obj_module_t pulseio_module; #define PULSEIO_MODULE #endif +#if CIRCUITPY_PS2IO +extern const struct _mp_obj_module_t ps2io_module; +#define PS2IO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_ps2io), (mp_obj_t)&ps2io_module }, +#else +#define PS2IO_MODULE +#endif + #if CIRCUITPY_RANDOM extern const struct _mp_obj_module_t random_module; #define RANDOM_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_random), (mp_obj_t)&random_module }, @@ -580,6 +587,7 @@ extern const struct _mp_obj_module_t ustack_module; PEW_MODULE \ PIXELBUF_MODULE \ PULSEIO_MODULE \ + PS2IO_MODULE \ RANDOM_MODULE \ RE_MODULE \ ROTARYIO_MODULE \ diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index b436929e0..ed9b9f461 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -153,6 +153,12 @@ CIRCUITPY_PULSEIO = 1 endif CFLAGS += -DCIRCUITPY_PULSEIO=$(CIRCUITPY_PULSEIO) +# Only for SAMD boards for the moment +ifndef CIRCUITPY_PS2IO +CIRCUITPY_PS2IO = 0 +endif +CFLAGS += -DCIRCUITPY_PS2IO=$(CIRCUITPY_PS2IO) + ifndef CIRCUITPY_RANDOM CIRCUITPY_RANDOM = 1 endif |
