I'm trying to reduce my sketch size and managed to reduce both SRAM and Flash memory.
From:
1570 SRAM - 32144 Flash memory
To:
644 SRAM - 19458 Flash memory
This are what I've done so far:
✓ Enabling LTO
✓ Using PROGMEM
✓ Dropping string
and using char
✓ Dropping bootloader
✓ Using port manipulation
✓ Using registers to declare pins output/input
✓ Removing/Optimizing/Combining; unnecessary/repeated codes in the sketch
Using EEPROM is not an option for me.
What else i can do to take optimization one or two step further?
byte
instead ofint
for variables whose values are always between 0 and 255.