Skip to content

Conversation

AJMansfield
Copy link
Contributor

When trying to use this driver with a display with dimensions larger than 255x255, the arithmetic operations that attempt to format the width and height into a pair of bytes in the ssd1681 driver's power_up function leaves extra overflowing high-order bits in the low-order byte, resulting in an error: OverflowError: value must fit in 1 byte(s), originating from line 146 (for widths larger than 255) or 153 (for heights larger than 255).

This PR fixes this by explicitly masking out just the low byte; it also fixes another instance of this pattern in set_ram_address (though I've not gone into detail trying to figure out inputs to actually trigger an error from this instance).

I've tested this change using an 400x300 HINK-E042A88 SSD1683 display, connected via an Adafruit eInk Feather Friend to my Adafruit Feather RP2040.

Based on my tests I can confirm that this PR addresses the above issue; display operations appear to run correctly with it.

Need to explicitly truncate to just the low-order byte; otherwise, creating these bytearrays results in `OverflowError: value must fit in 1 byte(s)`.
@AJMansfield
Copy link
Contributor Author

Also: if I have the time I'll see if this pattern occurs in other drivers too and add fixes for them as well.

@BlitzCityDIY
Copy link
Contributor

i tested with a feather thinkink and a 1681 monochrome and 1683 tri-color. the driver is not working for the 1683, so i'll be adding a new driver for it. but the monochrome works as expected with this change

@BlitzCityDIY BlitzCityDIY merged commit 3ebcc90 into adafruit:main Aug 13, 2025
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 29, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 2.2.18 from 2.2.17:
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#71 from dhalbert/spi-lock-managment

Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.15.0 from 2.14.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#94 from adafruit/UC8197
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#95 from adafruit/ssd1883
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#93 from adafruit/ssd1680_fix
  > Merge pull request adafruit/Adafruit_CircuitPython_EPD#90 from AJMansfield/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_JD79661 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_JD79661#1 from adafruit/cleanup

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLV320 to 1.2.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#11 from samblenny/fix-example-link
  > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#10 from samblenny/volume-fixes

Updating https://github.com/adafruit/Adafruit_CircuitPython_FruitJam to 1.2.0 from 0.5.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#13 from FoamyGuy/volume_api
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#14 from mikeysklar/ntp-helper
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#12 from mikeysklar/headphone-speaker
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#11 from adafruit/TheKitty-patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#9 from relic-se/request_display_config-default
  > Merge pull request adafruit/Adafruit_CircuitPython_FruitJam#8 from relic-se/any_button_pressed-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_UC8253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants