diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-12-11 11:10:30 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-11 11:10:30 -0800 |
| commit | 344d3c59cba516aac28f6c7db4189d80b2bfb49d (patch) | |
| tree | 7439a48ff75a9a57576c8b8191c9af735da04e38 /py | |
| parent | d29184b5a0fb5c54663d48a8e8906564c3d518ad (diff) | |
| parent | d920750756624fae78c404548fbd55d331bb54b2 (diff) | |
Merge branch 'main' into msgpack
Diffstat (limited to 'py')
| -rw-r--r-- | py/circuitpy_defns.mk | 6 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.h | 14 | ||||
| -rw-r--r-- | py/circuitpy_mpconfig.mk | 3 | ||||
| -rw-r--r-- | py/mkenv.mk | 4 |
4 files changed, 25 insertions, 2 deletions
diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 39ff2e380..327bfff9b 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -136,6 +136,9 @@ endif ifeq ($(CIRCUITPY_BOARD),1) SRC_PATTERNS += board/% endif +ifeq ($(CIRCUITPY_BUSDEVICE),1) +SRC_PATTERNS += adafruit_bus_device/% +endif ifeq ($(CIRCUITPY_BUSIO),1) SRC_PATTERNS += busio/% bitbangio/OneWire.% endif @@ -442,6 +445,9 @@ SRC_SHARED_MODULE_ALL = \ bitbangio/SPI.c \ bitbangio/__init__.c \ board/__init__.c \ + adafruit_bus_device/__init__.c \ + adafruit_bus_device/I2CDevice.c \ + adafruit_bus_device/SPIDevice.c \ busio/OneWire.c \ canio/Match.c \ canio/Message.c \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index f04241380..f7f5755a7 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -336,6 +336,13 @@ extern const struct _mp_obj_module_t board_module; #define BOARD_UART_ROOT_POINTER #endif +#if CIRCUITPY_BUSDEVICE +extern const struct _mp_obj_module_t adafruit_bus_device_module; +#define BUSDEVICE_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_adafruit_bus_device), (mp_obj_t)&adafruit_bus_device_module }, +#else +#define BUSDEVICE_MODULE +#endif + #if CIRCUITPY_BUSIO extern const struct _mp_obj_module_t busio_module; #define BUSIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_busio), (mp_obj_t)&busio_module }, @@ -799,6 +806,7 @@ extern const struct _mp_obj_module_t msgpack_module; BITBANGIO_MODULE \ BLEIO_MODULE \ BOARD_MODULE \ + BUSDEVICE_MODULE \ BUSIO_MODULE \ CAMERA_MODULE \ CANIO_MODULE \ @@ -912,6 +920,12 @@ void supervisor_run_background_tasks_if_tick(void); #define CIRCUITPY_PYSTACK_SIZE 1536 #endif + +// Wait this long imediately after startup to see if we are connected to USB. +#ifndef CIRCUITPY_USB_CONNECTED_SLEEP_DELAY +#define CIRCUITPY_USB_CONNECTED_SLEEP_DELAY 5 +#endif + #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #define CIRCUITPY_VERBOSE_BLE 0 diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index 8fd20d622..8219a6c83 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -96,6 +96,9 @@ CFLAGS += -DCIRCUITPY_BLEIO=$(CIRCUITPY_BLEIO) CIRCUITPY_BOARD ?= 1 CFLAGS += -DCIRCUITPY_BOARD=$(CIRCUITPY_BOARD) +CIRCUITPY_BUSDEVICE ?= $(CIRCUITPY_FULL_BUILD) +CFLAGS += -DCIRCUITPY_BUSDEVICE=$(CIRCUITPY_BUSDEVICE) + CIRCUITPY_BUILTINS_POW3 ?= $(CIRCUITPY_FULL_BUILD) CFLAGS += -DCIRCUITPY_BUILTINS_POW3=$(CIRCUITPY_BUILTINS_POW3) diff --git a/py/mkenv.mk b/py/mkenv.mk index cb678e8e7..7e99f59c1 100644 --- a/py/mkenv.mk +++ b/py/mkenv.mk @@ -56,7 +56,7 @@ RM = rm RSYNC = rsync SED = sed # Linux has 'nproc', macOS has 'sysctl -n hw.logicalcpu', this is cross-platform -NPROC = $(PYTHON) -c 'import multiprocessing as mp; print(mp.cpu_count())' +NPROC = $(PYTHON3) -c 'import multiprocessing as mp; print(mp.cpu_count())' AS = $(CROSS_COMPILE)as CC = $(CROSS_COMPILE)gcc @@ -72,7 +72,7 @@ CXX += -m32 LD += -m32 endif -MAKE_FROZEN = $(PYTHON) $(TOP)/tools/make-frozen.py +MAKE_FROZEN = $(PYTHON3) $(TOP)/tools/make-frozen.py MPY_CROSS = $(TOP)/mpy-cross/mpy-cross MPY_TOOL = $(PYTHON3) $(TOP)/tools/mpy-tool.py PREPROCESS_FROZEN_MODULES = PYTHONPATH=$(TOP)/tools/python-semver $(TOP)/tools/preprocess_frozen_modules.py |
