aboutsummaryrefslogtreecommitdiffstats
path: root/docs/feature_oled_driver.md
diff options
context:
space:
mode:
authorTed M Lin <tedmlin@gmail.com>2020-02-11 16:38:20 -0500
committerGitHub <noreply@github.com>2020-02-11 21:38:20 +0000
commit9456832a3bba4dd766a26a6286e78d3e88e4efce (patch)
treed5dfa046e2a8c08c9f8a8e597732f7764f453ee6 /docs/feature_oled_driver.md
parent78e060f55adef8de358ba4bf7f5d5854a70dd421 (diff)
downloadfirmware-9456832a3bba4dd766a26a6286e78d3e88e4efce.tar.gz
firmware-9456832a3bba4dd766a26a6286e78d3e88e4efce.tar.bz2
firmware-9456832a3bba4dd766a26a6286e78d3e88e4efce.zip
Fix out of bound OLED font access (#8145)
* Fix out of bound OLED font access The default font is 1344 bytes, or a total of 224 glyphs (each 6-bytes wide). OLED_FONT_END defaults to 224, which if used will then index off the end of the font array. So either the documentation or code is wrong. Instead of figuring out the rewording of the documentation, just change the OLED_FONT_END default value to 223, to match the documentation and code. * Add static assert to check array size Build bomb if the font array size doesn't match to the defines.
Diffstat (limited to 'docs/feature_oled_driver.md')
-rw-r--r--docs/feature_oled_driver.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/feature_oled_driver.md b/docs/feature_oled_driver.md
index 29548cb82..ebabc314f 100644
--- a/docs/feature_oled_driver.md
+++ b/docs/feature_oled_driver.md
@@ -104,7 +104,7 @@ void oled_task_user(void) {
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|`OLED_FONT_START` |`0` |The starting characer index for custom fonts |
-|`OLED_FONT_END` |`224` |The ending characer index for custom fonts |
+|`OLED_FONT_END` |`223` |The ending characer index for custom fonts |
|`OLED_FONT_WIDTH` |`6` |The font width |
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|`OLED_TIMEOUT` |`60000` |Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |