aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/keyboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/keyboard.c')
-rw-r--r--tmk_core/common/keyboard.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index fd2cf74f5..c962a721c 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -177,6 +177,9 @@ void keyboard_task(void)
177 static uint8_t led_status = 0; 177 static uint8_t led_status = 0;
178 matrix_row_t matrix_row = 0; 178 matrix_row_t matrix_row = 0;
179 matrix_row_t matrix_change = 0; 179 matrix_row_t matrix_change = 0;
180#ifdef QMK_KEYS_PER_SCAN
181 uint8_t keys_processed = 0;
182#endif
180 183
181 matrix_scan(); 184 matrix_scan();
182 if (is_keyboard_master()) { 185 if (is_keyboard_master()) {
@@ -208,6 +211,10 @@ void keyboard_task(void)
208 }); 211 });
209 // record a processed key 212 // record a processed key
210 matrix_prev[r] ^= ((matrix_row_t)1<<c); 213 matrix_prev[r] ^= ((matrix_row_t)1<<c);
214#ifdef QMK_KEYS_PER_SCAN
215 // only jump out if we have processed "enough" keys.
216 if (++keys_processed >= QMK_KEYS_PER_SCAN)
217#endif
211 // process a key per task call 218 // process a key per task call
212 goto MATRIX_LOOP_END; 219 goto MATRIX_LOOP_END;
213 } 220 }
@@ -216,6 +223,10 @@ void keyboard_task(void)
216 } 223 }
217 } 224 }
218 // call with pseudo tick event when no real key event. 225 // call with pseudo tick event when no real key event.
226#ifdef QMK_KEYS_PER_SCAN
227 // we can get here with some keys processed now.
228 if (!keys_processed)
229#endif
219 action_exec(TICK); 230 action_exec(TICK);
220 231
221MATRIX_LOOP_END: 232MATRIX_LOOP_END: