bremme / arduino-tm1637

Arduino library for using a 4 digit seven segment display with TM1636 or TM1637 driver IC
GNU General Public License v2.0
164 stars 62 forks source link

Add support for all AVR MCUs #4

Closed per1234 closed 8 years ago

per1234 commented 8 years ago

Previously, the code only supported the arduino:standard variant and non-AVRs. This change causes the standard Arduino digital I/O functions to be used for all other AVRs.

I have reconsidered my previous pull request and removed the direct port access macros for ATmega32u4. The reason is that although they are significantly faster than the Arduino functions, they also significantly increase the program size, even after some refactoring to make them smaller and faster.

Using Arduino IDE 1.6.9 with Pro Micro:

type digitalLow/High average(us) Basic.ino program storage space(bytes)
Direct port access macros 2.68 13046
Arduino functions 6.40 7548
bremme commented 8 years ago

I've merged your pull request and will push a new version tonight. I haven't looked into it yet, but why do you think the direct port access macros use about twice as much space? Perhaps adding a direct port access method would be more efficient?