Skip to content

Commit ffe734e

Browse files
committed
Fresh combined checkin of _pixelbuf library.
1 parent 9678a5a commit ffe734e

File tree

19 files changed

+1190
-4
lines changed

19 files changed

+1190
-4
lines changed

docs/library/builtins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ Not all of these functions and types are turned on in all CircuitPython ports, f
7878

7979
.. classmethod:: from_bytes(bytes, byteorder)
8080

81-
In CircuitPython, `byteorder` parameter must be positional (this is
81+
In CircuitPython, ``byteorder`` parameter must be positional (this is
8282
compatible with CPython).
8383

8484
.. method:: to_bytes(size, byteorder)
8585

86-
In CircuitPython, `byteorder` parameter must be positional (this is
86+
In CircuitPython, ``byteorder`` parameter must be positional (this is
8787
compatible with CPython).
8888

8989
.. function:: isinstance()

ports/atmel-samd/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@ LDFLAGS += -mthumb -mcpu=cortex-m4
191191
BOOTLOADER_SIZE := 0x4000
192192
endif
193193

194+
ifdef EXCLUDE_PIXELBUF
195+
CFLAGS += -DEXCLUDE_PIXELBUF
196+
endif
197+
194198
SRC_ASF := \
195199
gcc/gcc/startup_$(CHIP_FAMILY).c \
196200
gcc/system_$(CHIP_FAMILY).c \
@@ -419,6 +423,11 @@ ifneq ($(CHIP_VARIANT),SAMR21G18A)
419423
audioio/WaveFile.c
420424
endif
421425

426+
ifndef EXCLUDE_PIXELBUF
427+
SRC_SHARED_MODULE += _pixelbuf/__init__.c \
428+
_pixelbuf/PixelBuf.c
429+
endif
430+
422431
# The smallest SAMD51 packages don't have I2S. Everything else does.
423432
ifneq ($(CHIP_VARIANT),SAMD51G18A)
424433
ifneq ($(CHIP_VARIANT),SAMD51G19A)

ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ LONGINT_IMPL = NONE
99

1010
CHIP_VARIANT = SAMD21G18A
1111
CHIP_FAMILY = samd21
12+
13+
EXCLUDE_PIXELBUF = 1

ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ EXTERNAL_FLASH_DEVICE_COUNT = 2
99
EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C"
1010
# Turn off longints for Crickit build to make room for additional frozen libs.
1111
LONGINT_IMPL = NONE
12+
# Disable pixelbuf to save room
13+
EXCLUDE_PIXELBUF = 1
1214

1315
CHIP_VARIANT = SAMD21G18A
1416
CHIP_FAMILY = samd21

ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ LONGINT_IMPL = NONE
99

1010
CHIP_VARIANT = SAMD21G18A
1111
CHIP_FAMILY = samd21
12+
13+
EXCLUDE_PIXELBUF = 1

ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ CFLAGS_INLINE_LIMIT = 45
1616
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_DotStar
1717
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_HID
1818
FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_IRRemote
19+
20+
EXCLUDE_PIXELBUF = 1

ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ LONGINT_IMPL = NONE
99

1010
CHIP_VARIANT = SAMD21E18A
1111
CHIP_FAMILY = samd21
12+
13+
EXCLUDE_PIXELBUF = 1

ports/atmel-samd/mpconfigport.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ extern const struct _mp_obj_module_t usb_midi_module;
241241
extern const struct _mp_obj_module_t network_module;
242242
extern const struct _mp_obj_module_t socket_module;
243243
extern const struct _mp_obj_module_t wiznet_module;
244+
#ifndef EXCLUDE_PIXELBUF
245+
extern const struct _mp_obj_module_t pixelbuf_module;
246+
#endif
244247

245248
// Internal flash size dependent settings.
246249
#if BOARD_FLASH_SIZE > 192000
@@ -308,6 +311,11 @@ extern const struct _mp_obj_module_t wiznet_module;
308311
#define JSON_MODULE
309312
#endif
310313

314+
#ifndef EXCLUDE_PIXELBUF
315+
#define PIXELBUF_MODULE { MP_OBJ_NEW_QSTR(MP_QSTR__pixelbuf),(mp_obj_t)&pixelbuf_module }
316+
#else
317+
#define PIXELBUF_MODULE
318+
#endif
311319

312320
#ifndef EXTRA_BUILTIN_MODULES
313321
#define EXTRA_BUILTIN_MODULES \
@@ -321,7 +329,8 @@ extern const struct _mp_obj_module_t wiznet_module;
321329
WIZNET_MODULE \
322330
JSON_MODULE \
323331
{ MP_OBJ_NEW_QSTR(MP_QSTR_rotaryio), (mp_obj_t)&rotaryio_module }, \
324-
{ MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }
332+
{ MP_OBJ_NEW_QSTR(MP_QSTR_gamepad),(mp_obj_t)&gamepad_module }, \
333+
PIXELBUF_MODULE
325334
#endif
326335
#define EXPRESS_BOARD
327336

ports/esp8266/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ SRC_SHARED_MODULE = \
148148
os/__init__.c \
149149
random/__init__.c \
150150
struct/__init__.c
151+
152+
ifndef EXCLUDE_PIXELBUF
153+
SRC_SHARED_MODULE += _pixelbuf/__init__.c \
154+
_pixelbuf/PixelBuf.c
155+
endif
151156

152157
SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) \
153158
$(addprefix shared-module/, $(SRC_SHARED_MODULE))

ports/nrf/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ SRC_SHARED_MODULE = \
214214
bitbangio/OneWire.c \
215215
bitbangio/SPI.c \
216216
busio/OneWire.c \
217-
storage/__init__.c
217+
storage/__init__.c
218+
219+
220+
ifndef EXCLUDE_PIXELBUF
221+
SRC_SHARED_MODULE += _pixelbuf/__init__.c \
222+
_pixelbuf/PixelBuf.c
223+
endif
218224

219225
# uheap/__init__.c \
220226
ustack/__init__.c

0 commit comments

Comments
 (0)