From b19138e82e32c512a8b9253519526ec1dc786378 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 22 Jun 2017 16:20:22 +1000 Subject: [PATCH] stmhal: Make available the _onewire module, for low-level bus control. --- stmhal/Makefile | 7 ++++++- stmhal/mpconfigport.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/stmhal/Makefile b/stmhal/Makefile index 73c7ed6c4c..0f3ce0d382 100644 --- a/stmhal/Makefile +++ b/stmhal/Makefile @@ -113,6 +113,10 @@ SRC_LIB = $(addprefix lib/,\ utils/sys_stdio_mphal.c \ ) +EXTMOD_SRC_C = $(addprefix extmod/,\ + modonewire.c \ + ) + DRIVERS_SRC_C = $(addprefix drivers/,\ memory/spiflash.c \ ) @@ -254,6 +258,7 @@ endif OBJ = OBJ += $(PY_O) OBJ += $(addprefix $(BUILD)/, $(SRC_LIB:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(EXTMOD_SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(DRIVERS_SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_O)) @@ -343,7 +348,7 @@ GEN_CDCINF_FILE = $(HEADER_BUILD)/pybcdc.inf GEN_CDCINF_HEADER = $(HEADER_BUILD)/pybcdc_inf.h # List of sources for qstr extraction -SRC_QSTR += $(SRC_C) $(SRC_MOD) $(SRC_LIB) +SRC_QSTR += $(SRC_C) $(SRC_MOD) $(SRC_LIB) $(EXTMOD_SRC_C) # Append any auto-generated sources that are needed by sources listed in # SRC_QSTR SRC_QSTR_AUTO_DEPS += $(GEN_CDCINF_HEADER) diff --git a/stmhal/mpconfigport.h b/stmhal/mpconfigport.h index 48588e9ae9..60003f30fc 100644 --- a/stmhal/mpconfigport.h +++ b/stmhal/mpconfigport.h @@ -175,6 +175,7 @@ extern const struct _mp_obj_module_t mp_module_uos; extern const struct _mp_obj_module_t mp_module_utime; extern const struct _mp_obj_module_t mp_module_usocket; extern const struct _mp_obj_module_t mp_module_network; +extern const struct _mp_obj_module_t mp_module_onewire; #if MICROPY_PY_USOCKET #define SOCKET_BUILTIN_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_usocket), (mp_obj_t)&mp_module_usocket }, @@ -198,6 +199,7 @@ extern const struct _mp_obj_module_t mp_module_network; { MP_OBJ_NEW_QSTR(MP_QSTR_utime), (mp_obj_t)&mp_module_utime }, \ SOCKET_BUILTIN_MODULE \ NETWORK_BUILTIN_MODULE \ + { MP_OBJ_NEW_QSTR(MP_QSTR__onewire), (mp_obj_t)&mp_module_onewire }, \ #define MICROPY_PORT_BUILTIN_MODULE_WEAK_LINKS \ { MP_OBJ_NEW_QSTR(MP_QSTR_binascii), (mp_obj_t)&mp_module_ubinascii }, \