mxmxmx / O_C

display w/ dac
470 stars 122 forks source link

Optimization question #104

Closed dylanreimer closed 4 years ago

dylanreimer commented 4 years ago

Hello,

I was just wondering what effects smallest code optimization has on the behavior of the firmware. I'd like to flash with serial usb type so I can flash in the future without having to manually enter program mode by pressing the program button, but the sketch currently is ~500 bytes too large.

Thanks, Dylan

patrickdowling commented 4 years ago

The somewhat generic answer is "it depends". The -Os setting changes the runtime behaviour and that's already borderline in some cases (see issue #98) so it's a bit of a gamble. IIRC there was a reason why it's not used but it's lost in the fog...

That said, if you use the fix/display_glitch branch, that not only fixes the glitch, but I added some minor tweaks that save some flash space.

With some major refactoring I got things down closer to 80% usage but that has serious side effects.

dylanreimer commented 4 years ago

Wonderful, tested with firmware from the new branch and it's working and flashing great. Thanks so much for the help!