Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avr-gcc complains about fonts not being "const" #3

Open
sprinkmeier opened this issue Jul 2, 2013 · 1 comment
Open

avr-gcc complains about fonts not being "const" #3

sprinkmeier opened this issue Jul 2, 2013 · 1 comment

Comments

@sprinkmeier
Copy link

the fonts are in PROGMEM but not declared as const.
the new avr-gcc complains about that.

trivial fix, not really worth a clone/pull request etc:

diff --git a/Arial_black_16.h b/Arial_black_16.h
index aa11fd9..638bee5 100644
--- a/Arial_black_16.h
+++ b/Arial_black_16.h
@@ -45,7 +45,7 @@
#define ARIAL_BLACK_16_WIDTH 10
#define ARIAL_BLACK_16_HEIGHT 16

-static uint8_t Arial_Black_16[] PROGMEM = {
+static const uint8_t Arial_Black_16[] PROGMEM = {
0x30, 0x86, // size
0x0A, // width
0x10, // height
diff --git a/SystemFont5x7.h b/SystemFont5x7.h
index 844dfe1..e5ab7e5 100644
--- a/SystemFont5x7.h
+++ b/SystemFont5x7.h
@@ -45,7 +45,7 @@

#define SystemFont5x7 System5x7

-static uint8_t System5x7[] PROGMEM = {
+static const uint8_t System5x7[] PROGMEM = {
0x0, 0x0, // size of zero indicates fixed width font, actual length is width * height
0x05, // width

0x07, // height

@berni-v
Copy link

berni-v commented Feb 28, 2015

This is because the tool "GLCD FontCreator2" used to create fonts from any windows font, creates the font data as static.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants