Skip to content

Commit b8333af

Browse files
authored
Merge pull request adafruit#226 from jarruda/master
Add splash opt-out.
2 parents 2ca4979 + f9fc8aa commit b8333af

File tree

4 files changed

+141
-201
lines changed

4 files changed

+141
-201
lines changed

Adafruit_SSD1306.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,13 +495,16 @@ bool Adafruit_SSD1306::begin(uint8_t vcs, uint8_t addr, bool reset,
495495
return false;
496496

497497
clearDisplay();
498+
499+
#ifndef SSD1306_NO_SPLASH
498500
if (HEIGHT > 32) {
499501
drawBitmap((WIDTH - splash1_width) / 2, (HEIGHT - splash1_height) / 2,
500502
splash1_data, splash1_width, splash1_height, 1);
501503
} else {
502504
drawBitmap((WIDTH - splash2_width) / 2, (HEIGHT - splash2_height) / 2,
503505
splash2_data, splash2_width, splash2_height, 1);
504506
}
507+
#endif
505508

506509
vccstate = vcs;
507510

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Preferred installation method is to use the Arduino IDE Library Manager. To down
1919
You will also have to install the **Adafruit GFX library** which provides graphics primitves such as lines, circles, text, etc. This also can be found in the Arduino Library Manager, or you can get the source from https://github.com/adafruit/Adafruit-GFX-Library
2020

2121
## Changes
22+
Pull Request:
23+
(November 2021)
24+
* Added define `SSD1306_NO_SPLASH` to opt-out of including splash images in `PROGMEM` and drawing to display during `begin`.
25+
2226
Pull Request:
2327
(September 2019)
2428
* new #defines for SSD1306_BLACK, SSD1306_WHITE and SSD1306_INVERSE that match existing #define naming scheme and won't conflict with common color names

scripts/Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11

22
PY=python3
33

4+
define HEADER
5+
/**
6+
* This file is autogenerated, do not edit.
7+
* Run `make` from the scripts directory to produce splash.h
8+
*
9+
* Splashes will be stored in PROGMEM (flash).
10+
* If SSD1306_NO_SPLASH is defined, the splashes are omitted.
11+
*/
12+
13+
#ifndef SSD1306_NO_SPLASH
14+
/* clang-format off */
15+
endef
16+
17+
define FOOTER
18+
/* clang-format on */
19+
#endif
20+
endef
21+
22+
export HEADER
23+
export FOOTER
24+
425
splash.h: make_splash.py splash1.png splash2.png
5-
${PY} make_splash.py splash1.png splash1 >$@
26+
echo "$$HEADER" > $@
27+
${PY} make_splash.py splash1.png splash1 >>$@
628
${PY} make_splash.py splash2.png splash2 >>$@
29+
echo "$$FOOTER" >> $@
730

831
clean:
932
rm -f splash.h

0 commit comments

Comments
 (0)