bitbank2 / ss_oled

Simple and small library to control 1-bpp OLED displays (Linux + Arduino)
GNU General Public License v3.0
186 stars 34 forks source link

Reduce Flash memory footprint when only one or two fonts are used. #18

Closed aa2mz closed 4 years ago

aa2mz commented 4 years ago

Making different "oledWriteString" routines for each font size allows the linker to eliminated unneeded fonts. This saves from 700 to 2000 bytes when only one or two fonts are required by the application.

The resulting code is call-compatible with the existing code base.

In addition to much more application code on, say, an ATTINY85 device, it also enables the use of the SIZE_LARGE font on AVR devices as desired by developers without having to modify installed library code.

bitbank2 commented 4 years ago

I've been thinking about your merge request the last few days. I understand your motivation for doing this, but it doesn't fit my plans for the library. I may change my mind at a future time, but for now I'm sorry to say I'm not going to merge your changes.

aa2mz commented 4 years ago

Thank you for your consideration. If you can say, do your plans include a "set-font" capability? I am interested in implementing further font size reduction by using font subsets but hate modifying well-maintained code. Thank's again.

On Sat, Nov 30, 2019, 7:38 AM Larry Bank notifications@github.com wrote:

I've been thinking about your merge request the last few days. I understand your motivation for doing this, but it doesn't fit my plans for the library. I may change my mind at a future time, but for now I'm sorry to say I'm not going to merge your changes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitbank2/ss_oled/pull/18?email_source=notifications&email_token=AKKPUURWOWC67CEEARXV5BDQWJNC5A5CNFSM4JSARJF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQFKNI#issuecomment-559961397, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKPUUUJ2E6GQKKLWP67GMLQWJNC5ANCNFSM4JSARJFQ .

bitbank2 commented 4 years ago

As it stands, I only include 96 characters for each font; this isn't a whole lot. The 6x8 font only use 576 bytes and the 8x8 font only uses 768 bytes. This is why your merge request seemed a little odd. On AVR targets, my default font data only takes a total of 1344 bytes and gives you 3 font size choices.

My next change will be to clean up the backbuffer code so that it can be optionally used on all targets instead of automatically disabling it on AVR.

aa2mz commented 4 years ago

Backbuffer is a very desirable feature, facilitates easy screen saver and burn-in prevention. (I've previously implemented blinking at the stretched-text level with a char[8] buffer and timer.) My "small footprint" need is focused at tiny85 (and now tiny84.) I think I should aim at an even simpler renderer and a single font with perhaps a numeric/math only option. Thank you for making such a nice package.

On Sat, Nov 30, 2019, 10:56 AM Larry Bank notifications@github.com wrote:

As it stands, I only include 96 characters for each font; this isn't a whole lot. The 6x8 font only use 576 bytes and the 8x8 font only uses 768 bytes. This is why your merge request seemed a little odd. On AVR targets, my default font data only takes a total of 1344 bytes and gives you 3 font size choices.

My next change will be to clean up the backbuffer code so that it can be optionally used on all targets instead of automatically disabling it on AVR.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitbank2/ss_oled/pull/18?email_source=notifications&email_token=AKKPUURBBATA5AFIP54D44DQWKEKTA5CNFSM4JSARJF2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFQLR6Y#issuecomment-559986939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKKPUUWED375UJ2ZBMEIQDTQWKEKTANCNFSM4JSARJFQ .