Problems with Bitmaps on TFT Display using GFX Library

Yes, it is bad practice to put executable code in H files.

Fonts and images tend to be inanimate data tables.

The Linker decides whether to actually put it in the HEX file i.e. only if it is actually used.

Placing in an H file means that the data table(s) are compiled in the same style as the main C or C++ file.
If you put in a C file, you must specify the appropriate external linkage. Not difficult but beyond the normal Arduino user.

YMMV.

David.

1 Like