Closed todbot closed 1 year ago
You may want to consider using
const()
frommicropython
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?
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
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.
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.
Currently library has incorrect pinmap for newer boards (PIDs 5690 & 5681). This PR adds a new pinmap file and test for it.