summaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
authorDaniel Pollard <daniel@learnweaver.com>2020-05-05 15:23:38 +1000
committerDaniel Pollard <daniel@learnweaver.com>2020-05-05 15:23:38 +1000
commitbfa5cd9c13e308df5462653a53fe99eeb0543bc3 (patch)
tree8655ba7f7a099f0705df220260ca0d1453d7e116 /py
parent54eb6d39e467e99a214c4ff2b19d061182de4fd0 (diff)
refactor countio based on feedback
Diffstat (limited to 'py')
-rw-r--r--py/circuitpy_defns.mk5
-rw-r--r--py/circuitpy_mpconfig.h8
-rw-r--r--py/circuitpy_mpconfig.mk11
3 files changed, 24 insertions, 0 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk
index ec8e6c3e9..a253f2fa8 100644
--- a/py/circuitpy_defns.mk
+++ b/py/circuitpy_defns.mk
@@ -136,6 +136,9 @@ endif
ifeq ($(CIRCUITPY_BUSIO),1)
SRC_PATTERNS += busio/% bitbangio/OneWire.%
endif
+ifeq ($(CIRCUITPY_COUNTIO),1)
+SRC_PATTERNS += countio/%
+endif
ifeq ($(CIRCUITPY_DIGITALIO),1)
SRC_PATTERNS += digitalio/%
endif
@@ -263,6 +266,8 @@ SRC_COMMON_HAL_ALL = \
busio/SPI.c \
busio/UART.c \
busio/__init__.c \
+ countio/Counter.c \
+ countio/__init__.c \
digitalio/DigitalInOut.c \
digitalio/__init__.c \
displayio/ParallelBus.c \
diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h
index 29a4d524c..a3ab4da94 100644
--- a/py/circuitpy_mpconfig.h
+++ b/py/circuitpy_mpconfig.h
@@ -314,6 +314,13 @@ extern const struct _mp_obj_module_t busio_module;
#define BUSIO_MODULE
#endif
+#if CIRCUITPY_COUNTIO
+extern const struct _mp_obj_module_t countio_module;
+#define COUNTIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_countio), (mp_obj_t)&countio_module },
+#else
+#define COUNTIO_MODULE
+#endif
+
#if CIRCUITPY_DIGITALIO
extern const struct _mp_obj_module_t digitalio_module;
#define DIGITALIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_digitalio), (mp_obj_t)&digitalio_module },
@@ -630,6 +637,7 @@ extern const struct _mp_obj_module_t ustack_module;
BLEIO_MODULE \
BOARD_MODULE \
BUSIO_MODULE \
+ COUNTIO_MODULE \
DIGITALIO_MODULE \
DISPLAYIO_MODULE \
FONTIO_MODULE \
diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk
index 30ab720d7..7ef87a7ea 100644
--- a/py/circuitpy_mpconfig.mk
+++ b/py/circuitpy_mpconfig.mk
@@ -109,6 +109,12 @@ CIRCUITPY_DIGITALIO = 1
endif
CFLAGS += -DCIRCUITPY_DIGITALIO=$(CIRCUITPY_DIGITALIO)
+ifndef CIRCUITPY_COUNTIO
+CIRCUITPY_COUNTIO = 1
+endif
+CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO)
+
+
ifndef CIRCUITPY_DISPLAYIO
CIRCUITPY_DISPLAYIO = $(CIRCUITPY_FULL_BUILD)
endif
@@ -207,6 +213,11 @@ CIRCUITPY_ROTARYIO = 1
endif
CFLAGS += -DCIRCUITPY_ROTARYIO=$(CIRCUITPY_ROTARYIO)
+ifndef CIRCUITPY_COUNTIO
+CIRCUITPY_COUNTIO = 1
+endif
+CFLAGS += -DCIRCUITPY_COUNTIO=$(CIRCUITPY_COUNTIO)
+
ifndef CIRCUITPY_RTC
CIRCUITPY_RTC = 1
endif