-
-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Optional OLED splash screen and fixed OLED i2c execution time saving #12294
Conversation
…execution time saving
To be precise, setting memory mode to 0x10 isn't completely invalid, because the 6 high bits are "don't care". The two LSBs end up setting the memory mode to Horizontal Addressing Mode. Both the way the memory mode is being assigned and the way the code in send_buffer was written suggest that the intent was to use page addressing mode, but the approach was abandoned, resulting the pointless evaluation of |
Thank you for your contribution! |
…12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
…mk#12294) * Made OLED splash screen optional to reduce memory and fixed OLED i2c execution time saving * moved OLED address updates into their respective conditional checks
Description
#define NO_LCD_SPLASH
The OLED splash screen initialization with QMK logo is pretty but takes up program memory bytes. This change makes the splash screen conditional based on a new config.h #define. If #define NO_LCD_SPLASH is used, the OLED buffer is initialized to {0}. Testing with a 128x32 OLED shows a program size reduction about 500 bytes (128*32/8 = 512 bytes)
OLED Page Addressing fix
Also, an error was found in the OLED buffer writing function. As per SSD1306 datasheet, page 30 the options for "Set Memory Addressing Mode" are:
However, the memory mode was being set to 0x10, which is not a valid option. Based on the code in send_buffer(), it appears that the intent was to use Page Addressing Mode, but the code to save i2c execution time was not implemented correctly. As written, the
page_addr != i
will always evaluate to true (because no compatible OLED has 2k vertical pixels) so the page address gets rewritten each time, even when it does not need to be updated.This fix sets the memory addressing to page addressing mode (setting it to 10b = 0x02 instead of 0x10) and modifies the send_buffer code to actually track whether the page address needs to be re-sent.
Types of Changes
Checklist