Closed SpenceKonde closed 4 years ago
This is now implemented. The performance implications of this were bizarre - it SLOWED pinmode by 6 clocks (no idea why - I mean I can see why from the assembly listing: it's pushing r28 and r29 onto the stack at the start of pinMode, and popping them at the end - (2+1)*2=6 - but why it has to do this isn't clear, since it doesn't seem to actually use those registers....), sped up digitalWrite by 2 clocks.... and digitalRead() by an insane 52 clocks (almost 2:1!) and analogWrite() by 25. Since it's on balance an improvement, it's going into the release.
They currently use PROGMEM and the pgm_read_byte() call - because of the unified memory architecture of the tinyAVR 0-series and 1-series parts, this can be changed without loss of functionality to simply use const[] variables and cut out the extra LPM instruction.