qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
17.81k stars 38.16k forks source link

[Bug] Keyboard freezes after a few keystrokes #12536

Closed mvuksano closed 3 years ago

mvuksano commented 3 years ago

After a few keystrokes, keyboard does not produce any more key presses.

Describe the Bug

I am using Massdrop OLKB keyboard with latest firmware. My intent was to create a log of key press events so I can further analyze it and create a heat map of my keyboard usage.

System Information

Additional Context

Following is the diff of the changes that cause the keyboard to stop responding. Without applying this diff the keyboard works as expected.

diff --git a/keyboards/planck/keymaps/marko/keymap.c b/keyboards/planck/keymaps/marko/keymap.c
index ab9899edb..7316e2697 100644
--- a/keyboards/planck/keymaps/marko/keymap.c
+++ b/keyboards/planck/keymaps/marko/keymap.c
@@ -17,6 +17,10 @@
 #include QMK_KEYBOARD_H
 #include "muse.h"

+#ifdef CONSOLE_ENABLE
+#include "print.h"
+#endif
+

 enum planck_layers {
   _QWERTY,
@@ -181,6 +185,11 @@ layer_state_t layer_state_set_user(layer_state_t state) {
 }

 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+  #ifdef CONSOLE_ENABLE
+    if (record->event.pressed) {
+      uprintf("0x04X,%u,%u,%u\n", keycode, record->event.key.row, record->event.key.col, get_highest_layer(layer_state));
+    }
+  #endif
   switch (keycode) {
     case QWERTY:
       if (record->event.pressed) {
diff --git a/keyboards/planck/keymaps/marko/rules.mk b/keyboards/planck/keymaps/marko/rules.mk
index 1b5789717..35cc9d5ef 100644
--- a/keyboards/planck/keymaps/marko/rules.mk
+++ b/keyboards/planck/keymaps/marko/rules.mk
@@ -1,3 +1,4 @@
 SRC += muse.c

 KEY_LOCK_ENABLE = yes
+CONSOLE_ENABLE = yes
zvecr commented 3 years ago

Duplicate of #5631