Skip to content

Commit

Permalink
Fix call order of encoder_init in keyboard_init
Browse files Browse the repository at this point in the history
encoder_init initializes thisCount which is used in encoder_state_raw
memcpy. quantum_init was calling encoder_state_raw though the
initialization of bootmatgic calling matrix_scan. This caused undefined
behavior resulting in bad values being sent over transport. Adjusting
the call order of encoder_init allows for correct behavior of
encoder_state_raw
  • Loading branch information
chrishoage committed Nov 26, 2022
1 parent e12ca14 commit 8a62d2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quantum/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ void keyboard_init(void) {
#endif
#ifdef SPLIT_KEYBOARD
split_pre_init();
#endif
#ifdef ENCODER_ENABLE
encoder_init();
#endif
matrix_init();
quantum_init();
Expand All @@ -374,9 +377,6 @@ void keyboard_init(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_init();
#endif
#ifdef ENCODER_ENABLE
encoder_init();
#endif
#ifdef STENO_ENABLE_ALL
steno_init();
#endif
Expand Down

0 comments on commit 8a62d2c

Please sign in to comment.