Skip to content

1.3.0

Latest

Choose a tag to compare

@lovyan03 lovyan03 released this 06 Nov 00:07
dd228d1

Breaking changes

  • Sprites in PSRAM on ESP32-S3 / C5 / C61 / P4 are pushed through DMA, so pushSprite() of a PSRAM sprite is asynchronous like an internal RAM sprite. A plain pushSprite() still completes at the outermost endWrite(), but code that keeps startWrite() held and redraws the same canvas right after pushing it must first wait on the destination: display.waitDMA(), not the sprite's waitDMA() (or use two canvases). The same applies before deleteSprite(), createSprite() or setColorDepth() on a sprite that was just pushed. With flash encryption enabled, C5 / C61 / P4 keep the CPU path. (#929)
  • Panel_ED2208::display() no longer blocks: the panel runs power-on, refresh, power-off and deep sleep on its own (AUTO) and the call returns after about 1 s instead of waiting for the whole refresh. Code that cuts the power right after display() must call waitDisplay() first. (#956, #969)
  • pushSprite() always lets the destination bus read the sprite buffer directly until the transfer completes; the bus decides whether DMA can read it (it copies or uses the CPU otherwise). On ESP32 targets nothing new is read by DMA. On RP2040 / SAMD51, a sprite on a user buffer (setBuffer()) is now sent by DMA instead of the CPU / an internal copy, so with startWrite() held, call waitDMA() on the destination before modifying or freeing that buffer. A custom IBus must check whether it can read the source by DMA: use_dma = true no longer implies DMA-capable memory. (#971)
  • Object layouts changed (new members in the SPI buses and Panel_ED2208): rebuild the library and all code that uses its classes; mixing objects built against the previous release is unsupported. (#930, #956, #971)
  • lgfx::heap_capable_dma(ptr) (ESP32 family) also returns true for external RAM (PSRAM) on chips whose DMA can read it (ESP32-S3 / C5 / C61 / P4 with ESP-IDF 5.2 or later). A custom bus or panel that used it to tell internal RAM apart must use esp_ptr_internal() instead, and call lgfx::dma_cache_sync() before handing a PSRAM buffer to DMA. (#929)

SPI / DMA

  • Segmented-Configure-Transfer on ESP32-S3 / C3 / C6 / C2 / H2: a DMA transfer over 32 KB is started once and the CPU is free until it completes, instead of restarting every 32 KB segment from the CPU and busy-waiting in between. pushImageDMA() of a 320x240 RGB565 image returns after 16 µs instead of 24 ms (transfer time unchanged); a clipped pushSprite() of the same size returns after 3 ms instead of 26 ms. Defining LGFX_SPI_SCT_DISABLE when compiling the library turns it off without changing the class layout. ESP-IDF 6.1 moved the capability macro from soc_caps.h to hal/spi_ll.h; it is found there too, so the path is no longer compiled out on 6.1. (#930, #948)
  • Sprites in PSRAM go through DMA on ESP32-S3 / C5 / C61 / P4, using the external-RAM DMA path that pushImageDMA() has had since 1.2.31. The CPU is free during the transfer instead of feeding the SPI FIFO 64 bytes at a time; a transfer from PSRAM takes about 0.9 ms longer per 25 KB for the write-back. (#929)

E-paper

  • Panel_ED2208 (6-color E Ink): display() sends and refreshes only the modified rectangle (partial window) instead of the whole panel. A refresh still takes about 15 s, but the rest of the screen keeps its image instead of flashing through the colors. (#986)

Fixes

  • Panel_ED2208 (6-color E Ink): the controller was never reset, so a panel left in deep sleep by a previous program did not wake up (BUSY stayed low, every wait timed out, init() took up to 40 s), and the 20 s refresh wait was shorter than a refresh (15 to 30 s), so power-off was sent mid-refresh. init() / wakeup() reset the controller (the image is kept), the refresh runs under AUTO, setSleep(true) uses the bus like the other commands, and the BUSY wait ends at the first high (display() 1.12 s instead of 1.33 s). (#956, #969)
  • ESP-IDF targets newer than the ESP32-C61 (ESP32-S31 / H21 in the ESP-IDF 6.1 preview) failed to build or fell through to the ESP32 code path, because the platform code named the chips it knew. Chip-specific code is now selected by what the target's headers provide; the existing targets keep their code paths. (#933)
  • QSPI panels (Panel_AMOLED, ST77916, NV3031B, NV3041A, SH8601Z): a horizontally clipped image drew nothing on a panel driven without a frame buffer: the rows were queued without the pixel-write start, or each row restarted the write and rewound to the window start. The write is now started once for all rows. (#971)
  • RP2040 SPI: a halfword DMA was used from an odd source address, and the DMA channel, DC and frame width were changed while a previous DMA could still be feeding the FIFO (only SPI BSY was checked). The halfword DMA now needs an even address, and those changes wait for the DMA transfer; wait() includes it and busy() reports it. (#971)
  • SAMD51 SPI: a direct DMA transfer over 65535 beats was truncated; it is now split. wait() / busy() include the DMA channel, and without a channel the transfer uses the CPU. (#971)
  • Software I2C (negative ports): init issues nine STOP conditions on fixed 5 µs steps, so a device left mid transfer by earlier traffic on the same pins answers again. Skipped for a pin number the platform cannot drive. (#973)
  • Frame-buffer panels that send only the modified area (Panel_AMOLED / CO5300, Panel_ED2208) missed pixels drawn by pushAlphaImage() / anti-aliased drawing, and by writePixels() / pushPixels() on a rotated screen: the alpha path did not record its area, and the rotated path recorded a shifted one. (#986)
  • Panel_DSI allocated a second frame buffer that was never used. Only one is allocated now, which leaves 1.8 MB more PSRAM free on a 720x1280 RGB565 panel. (#996)

Internal

  • Compiler warnings from the library sources and from the ESP-IDF headers it includes are cleared (66 → 4 in the library, 7 → 0 from the headers; they appeared in user builds); no change in behavior. (#950)
  • CI: the build workflows also run when only .inl files change. (#937)
  • The meaning of use_dma is documented on Bus / Panel / LGFXBase::pushImage: true lets the bus keep reading the caller's buffer until the transfer completes, false means it is not read after the call returns. (#971)
  • Comments added since 1.2.33 are in English, and the error_t descriptions are updated (mode_mismatch also covers a nested beginTransaction and a call from a task that does not own the I2C transaction). Comments only. (#972)
  • A comment in the ESP32 I2C code describes the current behavior instead of comparing with an earlier version. Comment only. (#991)
  • Japanese comments added in recent changes are in English; three that did not match the code are corrected (the EPD blit return value, the placement of an I2C force-stop note, the EPD frame buffer cache note). Comments only. (#992)
  • pushSprite() documents that the destination (display.waitDMA()), not the sprite, is waited on before the sprite buffer is modified, recreated or freed. Comments only. (#995)

Deprecated

  • SpriteBuffer::use_dma(): DMA eligibility is decided by the destination bus. (#971)