adafruit / Adafruit_CircuitPython_TLC59711

CircuitPython module for the TLC59711 16-bit 12 channel RGB LED PWM driver.
MIT License
6 stars 13 forks source link

TLC59711 driver not working with CircuitPython 7.1 on small int boards #21

Open tomeskenazi opened 2 years ago

tomeskenazi commented 2 years ago

The TLC59711 library example "tlc59711_simpletest.py" fails to run on Trinket M0 with CircuitPython 7.1.

This issue has been discussed on the Adafruit forum: https://forums.adafruit.com/viewtopic.php?f=60&t=186817&p=905169#p905169

2 issues have been identified:

1) Memory Allocation error It seems the library is too big to be loaded in memory on the Trinket M0. This could be fixed by shortening the library (e.g. removing the TLC59711AutoShow class if not used) and recompiling the mpy.

2) Small Int Overflow An OverflowError is thrown by the TLC59711 class constructor. It seems the driver assumes it can use 32-bit integers as the following trace suggests: Traceback (most recent call last): File "main.py", line 23, in File "adafruit_tlc59711.py", line 306, in init File "adafruit_tlc59711.py", line 315, in _init_buffer File "adafruit_tlc59711.py", line 438, in _chip_set_WriteCommand File "adafruit_tlc59711.py", line 327, in set_chipheader_bits_in_buffer OverflowError: small int overflow

The library was working fine with CircuitPython 3.1.1, version shipped with the Trinket M0.

s-light commented 2 years ago

for point 1: wold it help to just split this into multiple files? i could do this easily..

for point 2: i don't remember out of my head - i think yes it uses 32-bit integers for storing things and moving around..

what is the change between 3.1 and 7.1 that leads to not working anymore?