mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 05:02:07 +00:00
Shows logo on startup for 5 seconds
This commit is contained in:
parent
86e8ae126d
commit
67753d72e9
@ -197,10 +197,17 @@
|
||||
};
|
||||
#endif
|
||||
|
||||
// Default timeout for displaying logo on boot.
|
||||
#ifndef OLED_LOGO_TIMEOUT
|
||||
#define OLED_LOGO_TIMEOUT 5000
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
uint16_t startup_timer;
|
||||
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
startup_timer = timer_read();
|
||||
|
||||
if (is_keyboard_master()) {
|
||||
if(is_keyboard_left()){
|
||||
@ -214,6 +221,7 @@
|
||||
}
|
||||
}
|
||||
static void render_logo(void) {
|
||||
// @todo - should we split this into a seperate file? kb16 has a good example.
|
||||
static const char PROGMEM sofle_pico_logo[] = {
|
||||
// 'sofle-pico-vector-logo-v3bw', 64x128px
|
||||
0x00, 0x00, 0xf8, 0xfc, 0xdc, 0x8e, 0x0e, 0x0e, 0x1c, 0x1c, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
@ -315,6 +323,11 @@
|
||||
}
|
||||
|
||||
bool oled_task_user(void) {
|
||||
static bool finished_logo = false;
|
||||
if ((timer_elapsed(startup_timer) < OLED_LOGO_TIMEOUT) && !finished_logo) {
|
||||
render_logo();
|
||||
} else {
|
||||
finished_logo = true;
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
@ -322,5 +335,8 @@
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user