diff options
author | Allen Choi <37539914+Thunderbird2086@users.noreply.github.com> | 2022-04-13 16:03:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-13 00:03:01 -0700 |
commit | 935af9e9996083c2b7e82f67072899e87c7f45ab (patch) | |
tree | 1cfb4041286c784aec89a9492d76a57ca211dfc9 /keyboards/crkbd/keymaps/gotham/oled.c | |
parent | 6d816d94f7bf132a71cadbd08118469ac28c6480 (diff) |
[Keymap] fixed oled turn-off issue for crkbd:gotham (#16748)
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(); } |