Skip to content

Commit b2149f2

Browse files
committed
Fixing Copilot findings (2)
1 parent 347296c commit b2149f2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

ports/espressif/common-hal/qspibus/QSPIBus.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ void common_hal_qspibus_qspibus_construct(
352352
#ifdef CIRCUITPY_QSPIBUS_PANEL_POWER_PIN
353353
const mcu_pin_obj_t *power = CIRCUITPY_QSPIBUS_PANEL_POWER_PIN;
354354
if (power != NULL) {
355+
if (!common_hal_mcu_pin_is_free(power)) {
356+
mp_raise_ValueError_varg(MP_ERROR_TEXT("%q in use"), MP_QSTR_power);
357+
}
355358
self->power_pin = power->number;
356359
claim_pin(power);
357360
gpio_set_direction((gpio_num_t)self->power_pin, GPIO_MODE_OUTPUT);

shared-module/busdisplay/BusDisplay.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,12 @@ static bool _refresh_area(busdisplay_busdisplay_obj_t *self, const displayio_are
329329
remaining_rows -= rows_per_buffer;
330330

331331
#if CIRCUITPY_QSPIBUS
332-
if (is_qspi_bus) {
332+
if (is_qspi_bus &&
333+
self->core.colorspace.depth >= 8 &&
334+
!self->bus.data_as_commands &&
335+
!self->bus.SH1107_addressing) {
333336
// QSPI path: fill_area first (overlaps with previous DMA),
334337
// then single-transaction set_region + RAMWR + pixels.
335-
// depth is always 16 here (guarded by is_qspi_bus check above).
336338
uint32_t subrectangle_size_bytes = (uint32_t)displayio_area_size(&subrectangle) * (self->core.colorspace.depth / 8);
337339

338340
memset(mask, 0, mask_length * sizeof(mask[0]));

0 commit comments

Comments
 (0)