pimoroni / pimoroni-pico

Libraries and examples to support Pimoroni Pico add-ons in C++ and MicroPython.
https://shop.pimoroni.com/collections/pico
MIT License
1.23k stars 474 forks source link

Feature Request: Non-blocking PicoGraphics update() for Inky Frame #936

Open LionsPhil opened 2 months ago

LionsPhil commented 2 months ago

More-or-less what it says on the tin, and especially for the Inky Frame where the work being waited on is a ~40-second operation happening on the display controller. Either something like

display.update(blocking = False)

or

display.set_blocking(False)
display.update()

Exposing a matching is_busy() and/or busy_wait() would help use this safely.

Reasoning: I have a thin-client which does two things that are interacting unfortunately here:

That means the socket has to be held open, effectively buffering the image in the network, until that first update() has finished the e-ink dance---and makes having reasonable timeouts tougher. Ideally, the sequence would be:

(Yes, the network contents could be buffered to system RAM, flash, or an SD card, but only the latter reliably has enough space, and the framebuffer is right there to save the writes and further power overhead if PicoGraphics wasn't busy-waiting. :) )