summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/audiocore/RawSample.c1
-rw-r--r--shared-module/audiocore/RawSample.h1
-rw-r--r--shared-module/bitbangio/I2C.c1
-rw-r--r--shared-module/bitbangio/I2C.h43
-rw-r--r--shared-module/bitbangio/OneWire.c1
-rw-r--r--shared-module/bitbangio/OneWire.h39
-rw-r--r--shared-module/bitbangio/SPI.c4
-rw-r--r--shared-module/bitbangio/SPI.h (renamed from shared-module/bitbangio/types.h)20
-rw-r--r--shared-module/busio/I2C.h2
-rw-r--r--shared-module/busio/OneWire.h2
-rw-r--r--shared-module/displayio/Bitmap.c125
-rw-r--r--shared-module/displayio/Group.c2
-rw-r--r--shared-module/displayio/TileGrid.c39
-rw-r--r--shared-module/displayio/__init__.c14
-rw-r--r--shared-module/displayio/area.h2
-rw-r--r--shared-module/vectorio/VectorShape.c14
16 files changed, 217 insertions, 93 deletions
diff --git a/shared-module/audiocore/RawSample.c b/shared-module/audiocore/RawSample.c
index a69ddeb65..316a1c69f 100644
--- a/shared-module/audiocore/RawSample.c
+++ b/shared-module/audiocore/RawSample.c
@@ -43,7 +43,6 @@ void common_hal_audioio_rawsample_construct(audioio_rawsample_obj_t* self,
self->len = len;
self->channel_count = channel_count;
self->sample_rate = sample_rate;
- self->buffer_read = false;
}
void common_hal_audioio_rawsample_deinit(audioio_rawsample_obj_t* self) {
diff --git a/shared-module/audiocore/RawSample.h b/shared-module/audiocore/RawSample.h
index 6c2c19c9b..2ea8c89f4 100644
--- a/shared-module/audiocore/RawSample.h
+++ b/shared-module/audiocore/RawSample.h
@@ -39,7 +39,6 @@ typedef struct {
bool samples_signed;
uint8_t channel_count;
uint32_t sample_rate;
- bool buffer_read;
} audioio_rawsample_obj_t;
diff --git a/shared-module/bitbangio/I2C.c b/shared-module/bitbangio/I2C.c
index d44aec0e7..170630df6 100644
--- a/shared-module/bitbangio/I2C.c
+++ b/shared-module/bitbangio/I2C.c
@@ -32,7 +32,6 @@
#include "common-hal/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
-#include "shared-module/bitbangio/types.h"
#include "supervisor/shared/translate.h"
STATIC void delay(bitbangio_i2c_obj_t *self) {
diff --git a/shared-module/bitbangio/I2C.h b/shared-module/bitbangio/I2C.h
new file mode 100644
index 000000000..763c03adc
--- /dev/null
+++ b/shared-module/bitbangio/I2C.h
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Scott Shawcroft
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_I2C_H
+#define MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_I2C_H
+
+#include "common-hal/digitalio/DigitalInOut.h"
+
+#include "py/obj.h"
+
+typedef struct {
+ mp_obj_base_t base;
+ digitalio_digitalinout_obj_t scl;
+ digitalio_digitalinout_obj_t sda;
+ uint32_t us_delay;
+ uint32_t us_timeout;
+ volatile bool locked;
+} bitbangio_i2c_obj_t;
+
+#endif // MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_I2C_H
diff --git a/shared-module/bitbangio/OneWire.c b/shared-module/bitbangio/OneWire.c
index f5f479087..3e4ec8426 100644
--- a/shared-module/bitbangio/OneWire.c
+++ b/shared-module/bitbangio/OneWire.c
@@ -28,7 +28,6 @@
#include "shared-bindings/bitbangio/OneWire.h"
#include "shared-bindings/microcontroller/__init__.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
-#include "shared-module/bitbangio/types.h"
// Durations are taken from here: https://www.maximintegrated.com/en/app-notes/index.mvp/id/126
diff --git a/shared-module/bitbangio/OneWire.h b/shared-module/bitbangio/OneWire.h
new file mode 100644
index 000000000..bc4cb2096
--- /dev/null
+++ b/shared-module/bitbangio/OneWire.h
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the MicroPython project, http://micropython.org/
+ *
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2016 Scott Shawcroft
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H
+#define MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H
+
+#include "common-hal/digitalio/DigitalInOut.h"
+
+#include "py/obj.h"
+
+typedef struct {
+ mp_obj_base_t base;
+ digitalio_digitalinout_obj_t pin;
+} bitbangio_onewire_obj_t;
+
+#endif // MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_ONEWIRE_H
diff --git a/shared-module/bitbangio/SPI.c b/shared-module/bitbangio/SPI.c
index f3fe16029..9ed3d660a 100644
--- a/shared-module/bitbangio/SPI.c
+++ b/shared-module/bitbangio/SPI.c
@@ -29,9 +29,9 @@
#include "py/runtime.h"
#include "common-hal/microcontroller/Pin.h"
-#include "shared-bindings/microcontroller/__init__.h"
+#include "shared-bindings/bitbangio/SPI.h"
#include "shared-bindings/digitalio/DigitalInOut.h"
-#include "shared-module/bitbangio/types.h"
+#include "shared-bindings/microcontroller/__init__.h"
#include "supervisor/shared/translate.h"
#define MAX_BAUDRATE (common_hal_mcu_get_clock_frequency() / 48)
diff --git a/shared-module/bitbangio/types.h b/shared-module/bitbangio/SPI.h
index 6d1723474..f3e02c206 100644
--- a/shared-module/bitbangio/types.h
+++ b/shared-module/bitbangio/SPI.h
@@ -24,8 +24,8 @@
* THE SOFTWARE.
*/
-#ifndef MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_TYPES_H
-#define MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_TYPES_H
+#ifndef MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_SPI_H
+#define MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_SPI_H
#include "common-hal/digitalio/DigitalInOut.h"
@@ -33,20 +33,6 @@
typedef struct {
mp_obj_base_t base;
- digitalio_digitalinout_obj_t scl;
- digitalio_digitalinout_obj_t sda;
- uint32_t us_delay;
- uint32_t us_timeout;
- volatile bool locked;
-} bitbangio_i2c_obj_t;
-
-typedef struct {
- mp_obj_base_t base;
- digitalio_digitalinout_obj_t pin;
-} bitbangio_onewire_obj_t;
-
-typedef struct {
- mp_obj_base_t base;
digitalio_digitalinout_obj_t clock;
digitalio_digitalinout_obj_t mosi;
digitalio_digitalinout_obj_t miso;
@@ -58,4 +44,4 @@ typedef struct {
volatile bool locked:1;
} bitbangio_spi_obj_t;
-#endif // MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_TYPES_H
+#endif // MICROPY_INCLUDED_SHARED_MODULE_BITBANGIO_SPI_H
diff --git a/shared-module/busio/I2C.h b/shared-module/busio/I2C.h
index 8e3525f19..e089ea367 100644
--- a/shared-module/busio/I2C.h
+++ b/shared-module/busio/I2C.h
@@ -27,7 +27,7 @@
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_I2C_H
#define MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_I2C_H
-#include "shared-module/bitbangio/types.h"
+#include "shared-module/bitbangio/I2C.h"
#include "py/obj.h"
diff --git a/shared-module/busio/OneWire.h b/shared-module/busio/OneWire.h
index 9ffb89d49..5d80bab17 100644
--- a/shared-module/busio/OneWire.h
+++ b/shared-module/busio/OneWire.h
@@ -27,7 +27,7 @@
#ifndef MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_ONEWIRE_H
#define MICROPY_INCLUDED_ATMEL_SAMD_SHARED_MODULE_BUSIO_ONEWIRE_H
-#include "shared-module/bitbangio/types.h"
+#include "shared-module/bitbangio/OneWire.h"
#include "py/obj.h"
diff --git a/shared-module/displayio/Bitmap.c b/shared-module/displayio/Bitmap.c
index c9ea83428..1831ac697 100644
--- a/shared-module/displayio/Bitmap.c
+++ b/shared-module/displayio/Bitmap.c
@@ -105,17 +105,92 @@ uint32_t common_hal_displayio_bitmap_get_pixel(displayio_bitmap_t *self, int16_t
return 0;
}
+void displayio_bitmap_set_dirty_area(displayio_bitmap_t *self, int16_t x1, int16_t y1, int16_t x2, int16_t y2) {
+ // Update the bitmap's dirty region with the rectangle bounded by (x1,y1) and (x2, y2)
+
+ // Arrange x1 < x2, y1 < y2
+ if (x1 > x2) {
+ int16_t temp = x1;
+ x1 = x2;
+ x2 = temp;
+ }
+ if (y1 > y2) {
+ int16_t temp = y1;
+ y1 = y2;
+ y2 = temp;
+ }
+
+ // Update the dirty area.
+ if (self->dirty_area.x1 == self->dirty_area.x2) {
+ self->dirty_area.x1 = x1;
+ self->dirty_area.x2 = x2;
+ self->dirty_area.y1 = y1;
+ self->dirty_area.y2 = y2;
+ } else {
+ if (x1 < self->dirty_area.x1) {
+ self->dirty_area.x1 = x1;
+ }
+ if (x2 > self->dirty_area.x2) {
+ self->dirty_area.x2 = x2;
+ }
+ if (y1 < self->dirty_area.y1) {
+ self->dirty_area.y1 = y1;
+ }
+ if (y2 > self->dirty_area.y2) {
+ self->dirty_area.y2 = y2;
+ }
+ }
+}
+
+void displayio_bitmap_write_pixel(displayio_bitmap_t *self, int16_t x, int16_t y, uint32_t value) {
+ // Writes the color index value into a pixel position
+ // Must update the dirty area separately
+
+ // Update one pixel of data
+ int32_t row_start = y * self->stride;
+ uint32_t bytes_per_value = self->bits_per_value / 8;
+ if (bytes_per_value < 1) {
+ uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value);
+ uint32_t index = row_start + (x >> self->x_shift);
+ uint32_t word = self->data[index];
+ word &= ~(self->bitmask << bit_position);
+ word |= (value & self->bitmask) << bit_position;
+ self->data[index] = word;
+ } else {
+ size_t* row = self->data + row_start;
+ if (bytes_per_value == 1) {
+ ((uint8_t*) row)[x] = value;
+ } else if (bytes_per_value == 2) {
+ ((uint16_t*) row)[x] = value;
+ } else if (bytes_per_value == 4) {
+ ((uint32_t*) row)[x] = value;
+ }
+ }
+}
+
void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16_t y, displayio_bitmap_t *source,
int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t skip_index, bool skip_index_none) {
- // Copy complete "source" bitmap into "self" bitmap at location x,y in the "self"
- // Add a boolean to determine if all values are copied, or only if non-zero
+ // Copy region of "source" bitmap into "self" bitmap at location x,y in the "self"
// If skip_value is encountered in the source bitmap, it will not be copied.
// If skip_value is `None`, then all pixels are copied.
+ // This function assumes input checks were performed for pixel index entries.
if (self->read_only) {
mp_raise_RuntimeError(translate("Read-only object"));
}
+ // Update the dirty area
+ int16_t dirty_x_max = (x + (x2-x1));
+ if (dirty_x_max > self->width) {
+ dirty_x_max = self->width;
+ }
+ int16_t dirty_y_max = y + (y2-y1);
+ if (dirty_y_max > self->height) {
+ dirty_y_max = self->height;
+ }
+
+ displayio_bitmap_set_dirty_area(self, x, y, dirty_x_max, dirty_y_max);
+
bool x_reverse = false;
bool y_reverse = false;
@@ -142,7 +217,7 @@ void common_hal_displayio_bitmap_blit(displayio_bitmap_t *self, int16_t x, int16
if ((yd_index >= 0) && (yd_index < self->height) ) {
uint32_t value = common_hal_displayio_bitmap_get_pixel(source, xs_index, ys_index);
if ( (skip_index_none) || (value != skip_index) ) { // write if skip_value_none is True
- common_hal_displayio_bitmap_set_pixel(self, xd_index, yd_index, value);
+ displayio_bitmap_write_pixel(self, xd_index, yd_index, value);
}
}
}
@@ -154,45 +229,13 @@ void common_hal_displayio_bitmap_set_pixel(displayio_bitmap_t *self, int16_t x,
if (self->read_only) {
mp_raise_RuntimeError(translate("Read-only object"));
}
- // Update the dirty area.
- if (self->dirty_area.x1 == self->dirty_area.x2) {
- self->dirty_area.x1 = x;
- self->dirty_area.x2 = x + 1;
- self->dirty_area.y1 = y;
- self->dirty_area.y2 = y + 1;
- } else {
- if (x < self->dirty_area.x1) {
- self->dirty_area.x1 = x;
- } else if (x >= self->dirty_area.x2) {
- self->dirty_area.x2 = x + 1;
- }
- if (y < self->dirty_area.y1) {
- self->dirty_area.y1 = y;
- } else if (y >= self->dirty_area.y2) {
- self->dirty_area.y2 = y + 1;
- }
- }
- // Update our data
- int32_t row_start = y * self->stride;
- uint32_t bytes_per_value = self->bits_per_value / 8;
- if (bytes_per_value < 1) {
- uint32_t bit_position = (sizeof(size_t) * 8 - ((x & self->x_mask) + 1) * self->bits_per_value);
- uint32_t index = row_start + (x >> self->x_shift);
- uint32_t word = self->data[index];
- word &= ~(self->bitmask << bit_position);
- word |= (value & self->bitmask) << bit_position;
- self->data[index] = word;
- } else {
- size_t* row = self->data + row_start;
- if (bytes_per_value == 1) {
- ((uint8_t*) row)[x] = value;
- } else if (bytes_per_value == 2) {
- ((uint16_t*) row)[x] = value;
- } else if (bytes_per_value == 4) {
- ((uint32_t*) row)[x] = value;
- }
- }
+ // update the dirty region
+ displayio_bitmap_set_dirty_area(self, x, y, x+1, y+1);
+
+ // write the pixel
+ displayio_bitmap_write_pixel(self, x, y, value);
+
}
displayio_area_t* displayio_bitmap_get_refresh_areas(displayio_bitmap_t *self, displayio_area_t* tail) {
diff --git a/shared-module/displayio/Group.c b/shared-module/displayio/Group.c
index 42efeb18c..a36acc1c3 100644
--- a/shared-module/displayio/Group.c
+++ b/shared-module/displayio/Group.c
@@ -340,7 +340,7 @@ mp_obj_t common_hal_displayio_group_get(displayio_group_t* self, size_t index) {
void common_hal_displayio_group_set(displayio_group_t* self, size_t index, mp_obj_t layer) {
_add_layer(self, layer);
_remove_layer(self, index);
- mp_obj_list_store(self, MP_OBJ_NEW_SMALL_INT(index), layer);
+ mp_obj_list_store(self->members, MP_OBJ_NEW_SMALL_INT(index), layer);
}
void displayio_group_construct(displayio_group_t* self, mp_obj_list_t* members, uint32_t scale, mp_int_t x, mp_int_t y) {
diff --git a/shared-module/displayio/TileGrid.c b/shared-module/displayio/TileGrid.c
index 19ea10e55..96473d4a8 100644
--- a/shared-module/displayio/TileGrid.c
+++ b/shared-module/displayio/TileGrid.c
@@ -74,6 +74,7 @@ void common_hal_displayio_tilegrid_construct(displayio_tilegrid_t *self, mp_obj_
self->flip_x = false;
self->flip_y = false;
self->transpose_xy = false;
+ self->absolute_transform = NULL;
}
@@ -104,23 +105,30 @@ bool displayio_tilegrid_get_previous_area(displayio_tilegrid_t *self, displayio_
}
void _update_current_x(displayio_tilegrid_t *self) {
- int16_t width;
+ uint16_t width;
if (self->transpose_xy) {
width = self->pixel_height;
} else {
width = self->pixel_width;
}
- if (self->absolute_transform->transpose_xy) {
- self->current_area.y1 = self->absolute_transform->y + self->absolute_transform->dy * self->x;
- self->current_area.y2 = self->absolute_transform->y + self->absolute_transform->dy * (self->x + width);
+
+ // If there's no transform, substitute an identity transform so the calculations will work.
+ const displayio_buffer_transform_t* absolute_transform =
+ self->absolute_transform == NULL
+ ? &null_transform
+ : self->absolute_transform;
+
+ if (absolute_transform->transpose_xy) {
+ self->current_area.y1 = absolute_transform->y + absolute_transform->dy * self->x;
+ self->current_area.y2 = absolute_transform->y + absolute_transform->dy * (self->x + width);
if (self->current_area.y2 < self->current_area.y1) {
int16_t temp = self->current_area.y2;
self->current_area.y2 = self->current_area.y1;
self->current_area.y1 = temp;
}
} else {
- self->current_area.x1 = self->absolute_transform->x + self->absolute_transform->dx * self->x;
- self->current_area.x2 = self->absolute_transform->x + self->absolute_transform->dx * (self->x + width);
+ self->current_area.x1 = absolute_transform->x + absolute_transform->dx * self->x;
+ self->current_area.x2 = absolute_transform->x + absolute_transform->dx * (self->x + width);
if (self->current_area.x2 < self->current_area.x1) {
int16_t temp = self->current_area.x2;
self->current_area.x2 = self->current_area.x1;
@@ -130,23 +138,30 @@ void _update_current_x(displayio_tilegrid_t *self) {
}
void _update_current_y(displayio_tilegrid_t *self) {
- int16_t height;
+ uint16_t height;
if (self->transpose_xy) {
height = self->pixel_width;
} else {
height = self->pixel_height;
}
- if (self->absolute_transform->transpose_xy) {
- self->current_area.x1 = self->absolute_transform->x + self->absolute_transform->dx * self->y;
- self->current_area.x2 = self->absolute_transform->x + self->absolute_transform->dx * (self->y + height);
+
+ // If there's no transform, substitute an identity transform so the calculations will work.
+ const displayio_buffer_transform_t* absolute_transform =
+ self->absolute_transform == NULL
+ ? &null_transform
+ : self->absolute_transform;
+
+ if (absolute_transform->transpose_xy) {
+ self->current_area.x1 = absolute_transform->x + absolute_transform->dx * self->y;
+ self->current_area.x2 = absolute_transform->x + absolute_transform->dx * (self->y + height);
if (self->current_area.x2 < self->current_area.x1) {
int16_t temp = self->current_area.x2;
self->current_area.x2 = self->current_area.x1;
self->current_area.x1 = temp;
}
} else {
- self->current_area.y1 = self->absolute_transform->y + self->absolute_transform->dy * self->y;
- self->current_area.y2 = self->absolute_transform->y + self->absolute_transform->dy * (self->y + height);
+ self->current_area.y1 = absolute_transform->y + absolute_transform->dy * self->y;
+ self->current_area.y2 = absolute_transform->y + absolute_transform->dy * (self->y + height);
if (self->current_area.y2 < self->current_area.y1) {
int16_t temp = self->current_area.y2;
self->current_area.y2 = self->current_area.y1;
diff --git a/shared-module/displayio/__init__.c b/shared-module/displayio/__init__.c
index a9bb3b21b..740af0570 100644
--- a/shared-module/displayio/__init__.c
+++ b/shared-module/displayio/__init__.c
@@ -26,6 +26,20 @@
primary_display_t displays[CIRCUITPY_DISPLAY_LIMIT];
+displayio_buffer_transform_t null_transform = {
+ .x = 0,
+ .y = 0,
+ .dx = 1,
+ .dy = 1,
+ .scale = 1,
+ .width = 0,
+ .height = 0,
+ .mirror_x = false,
+ .mirror_y = false,
+ .transpose_xy = false
+};
+
+
#if CIRCUITPY_RGBMATRIX
STATIC bool any_display_uses_this_framebuffer(mp_obj_base_t *obj) {
for (uint8_t i = 0; i < CIRCUITPY_DISPLAY_LIMIT; i++) {
diff --git a/shared-module/displayio/area.h b/shared-module/displayio/area.h
index ec7c389b4..7ad36883c 100644
--- a/shared-module/displayio/area.h
+++ b/shared-module/displayio/area.h
@@ -51,6 +51,8 @@ typedef struct {
bool transpose_xy;
} displayio_buffer_transform_t;
+extern displayio_buffer_transform_t null_transform;
+
void displayio_area_union(const displayio_area_t* a,
const displayio_area_t* b,
displayio_area_t* u);
diff --git a/shared-module/vectorio/VectorShape.c b/shared-module/vectorio/VectorShape.c
index 81f46b3fa..b5d36339e 100644
--- a/shared-module/vectorio/VectorShape.c
+++ b/shared-module/vectorio/VectorShape.c
@@ -93,20 +93,6 @@ void common_hal_vectorio_vector_shape_set_dirty(void *vector_shape) {
}
-static displayio_buffer_transform_t null_transform = {
- .x = 0,
- .y = 0,
- .dx = 1,
- .dy = 1,
- .scale = 1,
- .width = 0,
- .height = 0,
- .mirror_x = false,
- .mirror_y = false,
- .transpose_xy = false
-};
-
-
void common_hal_vectorio_vector_shape_construct(vectorio_vector_shape_t *self,
vectorio_ishape_t ishape,
mp_obj_t pixel_shader, uint16_t x, uint16_t y) {