Skip to content

display.refresh() hangs infinitely #13

@jmodrako

Description

@jmodrako

Hey!

I'm using an e-ink display that is supported by this library. I've checked and call to display.refresh() stops and paused forever.

Do you have any clue what could be wrong?

Here is my code:

import time
import board
import displayio
import adafruit_ssd1680

displayio.release_displays()

# This pinout works on a Metro M4 and may need to be altered for other boards.
spi = board.SPI()  # Uses SCK and MOSI
epd_cs = board.D41
epd_dc = board.D40
epd_reset = board.D39  # Set to None for FeatherWing
epd_busy = board.D42  # Set to None for FeatherWing

print("1")

display_bus = displayio.FourWire(
    spi, command=epd_dc, chip_select=epd_cs, reset=epd_reset, baudrate=1000000
)

print("2")
time.sleep(1)

# For issues with display not updating top/bottom rows correctly set colstart to 8
display = adafruit_ssd1680.SSD1680(
    display_bus,
    colstart=8,
    width=250,
    height=122,
    busy_pin=epd_busy,
    highlight_color=0xFF0000,
    rotation=270,
)

print("3")

g = displayio.Group()

print("4")

with open("/display-ruler.bmp", "rb") as f:
    pic = displayio.OnDiskBitmap(f)
    
    print("5")
    
    # CircuitPython 6 & 7 compatible
    t = displayio.TileGrid(
        pic, pixel_shader=getattr(pic, "pixel_shader", displayio.ColorConverter())
    )
    
    print("6")
    
    # CircuitPython 7 compatible only
    # t = displayio.TileGrid(pic, pixel_shader=pic.pixel_shader)
    g.append(t)

    print("7")

    display.show(g)

    print("8")

    display.refresh()

    print("refreshed")

    time.sleep(120)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions