Closed alexey-medvedchikov closed 1 year ago
@jamwaffles No problemo!
Although I saved some space, I still can't squeeze my program into atmega168 - bme680 driver is a resource hog (making a small weather station with a screen). So I'll try to switch to a STM32 MCU, I can test this change there too later this week. I also have ESP8266 at hand, but I've never used it with Rust, so not sure if I can quickly check it.
LOL, I've just noticed that all the first and last bytes of each glyph in the font are zeros, so I just made the data array smaller by another 500 bytes. It is a bit clunky, but the font is hardcoded (and quite nice), so I don't think it is a problem. -3.5Kb total on atmega.
Tested on NUCLEO-F446ZE and ATMega168 with 128x64 and 128x32, all work fine.
Got rid of extra-sized arrays in Command::send
, cuts 80 bytes on Cortex-M4 and 260 bytes on ATMega168.
Thanks for the review. I accepted all your suggestions, a newbie in Rust, so make simple mistakes. Also, the merge conflict should be resolved now.
@jamwaffles checked and committed your changes. Thanks for spending so much time on this one!
This is released in v0.8.3. cargo update
should pull in the changes.
FYI I'm firmly opposed to https://github.com/jamwaffles/ssd1306/pull/195/commits/e309b41027e4219a17ba28200034eddcff25da77 as it means I'll have to duplicate the whole command table for the async interface.
Hi! Thank you for helping out with SSD1306 development! Please:
master
if you're not already up to dateCHANGELOG.md
entry in the Unreleased section under the appropriate heading (Added, Fixed, Changed, etc)rustfmt
on the project withcargo fmt --all
- CI will not pass without this stepPR description
This PR fixes issues with small AVRs:
match
. Saves around 3.5Kb of compiled code on AVR ATMega-s. Didn't test on other architectures, but pretty sure it will save some size too.AVR size difference
Before:
After:
STM32 (thumbv7em) size difference
Before:
After: