Skip to content

Commit ffb9ecf

Browse files
authored
Merge pull request #5139 from tannewt/onewireio
Move OneWire to `onewireio`
2 parents af823cc + 49dcdef commit ffb9ecf

File tree

24 files changed

+131
-551
lines changed

24 files changed

+131
-551
lines changed

ports/atmel-samd/common-hal/busio/OneWire.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

ports/cxd56/common-hal/busio/OneWire.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

ports/esp32s2/common-hal/busio/OneWire.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

ports/mimxrt10xx/common-hal/busio/OneWire.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

ports/raspberrypi/common-hal/busio/OneWire.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

py/circuitpy_defns.mk

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ ifeq ($(CIRCUITPY_BUSDEVICE),1)
155155
SRC_PATTERNS += adafruit_bus_device/%
156156
endif
157157
ifeq ($(CIRCUITPY_BUSIO),1)
158-
SRC_PATTERNS += busio/% bitbangio/OneWire.%
158+
SRC_PATTERNS += busio/%
159159
endif
160160
ifeq ($(CIRCUITPY_CAMERA),1)
161161
SRC_PATTERNS += camera/%
@@ -218,6 +218,9 @@ endif
218218
ifeq ($(CIRCUITPY_NVM),1)
219219
SRC_PATTERNS += nvm/%
220220
endif
221+
ifeq ($(CIRCUITPY_ONEWIREIO),1)
222+
SRC_PATTERNS += onewireio/%
223+
endif
221224
ifeq ($(CIRCUITPY_OS),1)
222225
SRC_PATTERNS += os/%
223226
endif
@@ -493,7 +496,6 @@ SRC_SHARED_MODULE_ALL = \
493496
audiomp3/__init__.c \
494497
audiopwmio/__init__.c \
495498
bitbangio/I2C.c \
496-
bitbangio/OneWire.c \
497499
bitbangio/SPI.c \
498500
bitbangio/__init__.c \
499501
bitmaptools/__init__.c \
@@ -502,7 +504,6 @@ SRC_SHARED_MODULE_ALL = \
502504
adafruit_bus_device/__init__.c \
503505
adafruit_bus_device/I2CDevice.c \
504506
adafruit_bus_device/SPIDevice.c \
505-
busio/OneWire.c \
506507
canio/Match.c \
507508
canio/Message.c \
508509
canio/RemoteTransmissionRequest.c \
@@ -522,6 +523,8 @@ SRC_SHARED_MODULE_ALL = \
522523
fontio/__init__.c \
523524
framebufferio/FramebufferDisplay.c \
524525
framebufferio/__init__.c \
526+
gamepadshift/GamePadShift.c \
527+
gamepadshift/__init__.c \
525528
getpass/__init__.c \
526529
ipaddress/IPv4Address.c \
527530
ipaddress/__init__.c \
@@ -531,15 +534,13 @@ SRC_SHARED_MODULE_ALL = \
531534
keypad/KeyMatrix.c \
532535
keypad/ShiftRegisterKeys.c \
533536
keypad/Keys.c \
534-
sdcardio/SDCard.c \
535-
sdcardio/__init__.c \
536-
gamepadshift/GamePadShift.c \
537-
gamepadshift/__init__.c \
538537
memorymonitor/__init__.c \
539538
memorymonitor/AllocationAlarm.c \
540539
memorymonitor/AllocationSize.c \
541540
network/__init__.c \
542541
msgpack/__init__.c \
542+
onewireio/__init__.c \
543+
onewireio/OneWire.c \
543544
os/__init__.c \
544545
qrio/__init__.c \
545546
qrio/QRDecoder.c \
@@ -548,6 +549,8 @@ SRC_SHARED_MODULE_ALL = \
548549
rgbmatrix/RGBMatrix.c \
549550
rgbmatrix/__init__.c \
550551
rotaryio/IncrementalEncoder.c \
552+
sdcardio/SDCard.c \
553+
sdcardio/__init__.c \
551554
sharpdisplay/SharpMemoryFramebuffer.c \
552555
sharpdisplay/__init__.c \
553556
socket/__init__.c \

py/circuitpy_mpconfig.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,13 @@ extern const struct _mp_obj_module_t neopixel_write_module;
583583
extern const struct _mp_obj_module_t nvm_module;
584584
#endif
585585

586+
#if CIRCUITPY_ONEWIREIO
587+
extern const struct _mp_obj_module_t onewireio_module;
588+
#define ONEWIREIO_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_onewireio), (mp_obj_t)&onewireio_module },
589+
#else
590+
#define ONEWIREIO_MODULE
591+
#endif
592+
586593
#if CIRCUITPY_OS
587594
extern const struct _mp_obj_module_t os_module;
588595
#define OS_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR_os), (mp_obj_t)&os_module },
@@ -915,6 +922,7 @@ extern const struct _mp_obj_module_t msgpack_module;
915922
MICROCONTROLLER_MODULE \
916923
MSGPACK_MODULE \
917924
NEOPIXEL_WRITE_MODULE \
925+
ONEWIREIO_MODULE \
918926
PEW_MODULE \
919927
PIXELBUF_MODULE \
920928
PS2IO_MODULE \

py/circuitpy_mpconfig.mk

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ CFLAGS += -DCIRCUITPY_GNSS=$(CIRCUITPY_GNSS)
199199
CIRCUITPY_I2CPERIPHERAL ?= $(CIRCUITPY_FULL_BUILD)
200200
CFLAGS += -DCIRCUITPY_I2CPERIPHERAL=$(CIRCUITPY_I2CPERIPHERAL)
201201

202+
CIRCUITPY_IMAGECAPTURE ?= 0
203+
CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE)
204+
202205
CIRCUITPY_IPADDRESS ?= $(CIRCUITPY_WIFI)
203206
CFLAGS += -DCIRCUITPY_IPADDRESS=$(CIRCUITPY_IPADDRESS)
204207

@@ -226,12 +229,12 @@ CFLAGS += -DCIRCUITPY_NEOPIXEL_WRITE=$(CIRCUITPY_NEOPIXEL_WRITE)
226229
CIRCUITPY_NVM ?= 1
227230
CFLAGS += -DCIRCUITPY_NVM=$(CIRCUITPY_NVM)
228231

232+
CIRCUITPY_ONEWIREIO ?= $(CIRCUITPY_BUSIO)
233+
CFLAGS += -DCIRCUITPY_ONEWIREIO=$(CIRCUITPY_ONEWIREIO)
234+
229235
CIRCUITPY_OS ?= 1
230236
CFLAGS += -DCIRCUITPY_OS=$(CIRCUITPY_OS)
231237

232-
CIRCUITPY_IMAGECAPTURE ?= 0
233-
CFLAGS += -DCIRCUITPY_IMAGECAPTURE=$(CIRCUITPY_IMAGECAPTURE)
234-
235238
CIRCUITPY_PEW ?= 0
236239
CFLAGS += -DCIRCUITPY_PEW=$(CIRCUITPY_PEW)
237240

shared-bindings/_bleio/Adapter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ const mp_obj_property_t bleio_adapter_name_obj = {
197197
//| """Starts advertising until `stop_advertising` is called or if connectable, another device
198198
//| connects to us.
199199
//|
200-
//| .. warning: If data is longer than 31 bytes, then this will automatically advertise as an
200+
//| .. warning:: If data is longer than 31 bytes, then this will automatically advertise as an
201201
//| extended advertisement that older BLE 4.x clients won't be able to scan for.
202202
//|
203-
//| .. note: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is
203+
//| .. note:: If you set ``anonymous=True``, then a timeout must be specified. If no timeout is
204204
//| specified, then the maximum allowed timeout will be selected automatically.
205205
//|
206206
//| :param ~_typing.ReadableBuffer data: advertising data packet bytes

0 commit comments

Comments
 (0)