adafruit / Adafruit_CircuitPython_seesaw

seesaw helper IC driver for circuitPython
MIT License
62 stars 36 forks source link

Support ATtiny1616 and ATtiny816 boards #112

Closed todbot closed 1 year ago

todbot commented 1 year ago

Currently library has incorrect pinmap for newer boards (PIDs 5690 & 5681). This PR adds a new pinmap file and test for it.

todbot commented 1 year ago

You may want to consider using const() from micropython and using underscore-starting global variables to save on memory space like the other similar classes do for memory optimization

Hi! I was just copying the pattern used in the existing attiny8x7.h file. (You'll see it's essentially the same file) Which code lines are you referring to?

tekktrik commented 1 year ago

Sorry, that wasn't very clear of me. I was referring to how the other "helper" classes here use _VARNAME = const(0x00) and then use those variables later on when defining pins. const() is a Micro/CircuitPython specific helper for the compiler to better optimize the use of numeric constants when they don't need to be whole Python objects, hence it's a good candidate here for optimization. An example of how it's currently used is here: https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/main/adafruit_seesaw/samd09.py

todbot commented 1 year ago

Sorry I am still confused. Which lines of code in this PR are you referring to? Are you referring to the analog_pins variable? I was copying attiny8x7.h. Are you suggesting I make changes to that file too? If so, that seems unrelated to this PR.

tekktrik commented 1 year ago

I was referring to doing the equivalent in your PR as is done in these lines here but I see now that the existing attiny8x7 file you linked doesn't do that. In that case, it can be left for a potential future improvement.