diff options
author | QMK Bot <hello@qmk.fm> | 2022-04-13 07:03:46 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-04-13 07:03:46 +0000 |
commit | 57d8bae083adf8688820dea53096ba2667507aa0 (patch) | |
tree | 0d0352226bad48014f9824584c5ea25e170fb49d /keyboards/crkbd/keymaps/gotham/oled.c | |
parent | 64aa180775fb5305d7a59e60fee27ee4e231e82c (diff) | |
parent | 935af9e9996083c2b7e82f67072899e87c7f45ab (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/crkbd/keymaps/gotham/oled.c')
-rw-r--r-- | keyboards/crkbd/keymaps/gotham/oled.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/keyboards/crkbd/keymaps/gotham/oled.c b/keyboards/crkbd/keymaps/gotham/oled.c index baacc86b18..6bf1233659 100644 --- a/keyboards/crkbd/keymaps/gotham/oled.c +++ b/keyboards/crkbd/keymaps/gotham/oled.c @@ -144,6 +144,7 @@ void render_feature_status(void) { // Keylogger #define KEYLOGGER_LENGTH 5 static uint16_t oled_timer = 0; +static bool is_key_processed = true; static char keylog_str[KEYLOGGER_LENGTH + 1] = {"\n"}; // clang-format off static const char PROGMEM code_to_name[0xFF] = { @@ -247,18 +248,13 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) { } bool oled_task_user(void) { - if (timer_elapsed(oled_timer) > 10000) { - oled_off(); - return; - } - #ifndef SPLIT_KEYBOARD - else { - oled_on(); - } - #endif - if (is_keyboard_master()) { - render_status_main(); + if (is_key_processed && (timer_elapsed(oled_timer) < OLED_KEY_TIMEOUT)) { + render_status_main(); + } else { + is_key_processed = false; + oled_off(); + } } else { render_status_secondary(); } |