ArduinoShrink library v0.1.0

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There have been many faster/better replacements for digitalWrite().  What I have not seen is a transparent replacement that works with the stock Arduino core.  ArduinoShrink does just that; existing calls to the Arduino functions do not have to be changed, just include ArduinoShrink.

https://github.com/nerdralph/Ard...

 

Props to Bill W. for figuring out that LTO allows gcc to evaluate PROGMEM arrays at compile time.  Without this technique, ArduinoShrink would've required it's own code for pin to port mapping.  Using the digital_pin_to_xxx_PGM arrays defined for each board variant in the AVR core made it possible for me two write the initial release of ArduinoShrink in one evening.

 

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just released v0.2.0.  The basic Blink sketch is now 192 bytes.  Since 100 of those bytes are for the vector table, there's not much more space to be saved.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've released v0.5.0.  Instead of using a busy loop, I decided to implement delay() using a timer to maintain functional compatibility with the official Arduino core.  Although the basic Blink sketch is now 286 bytes, code that uses millis() or micros() will benefit from the optimized assembler implementation in ArduinoShrink.

 

I have no special talents.  I am only passionately curious. - Albert Einstein