summaryrefslogtreecommitdiff
path: root/tmk_core/common/bootmagic.c
diff options
context:
space:
mode:
authorJosh Colbeck <skrymir@gmail.com>2016-07-04 15:41:58 -0500
committerJosh Colbeck <skrymir@gmail.com>2016-07-04 15:41:58 -0500
commita5fb2b58a5fc328da7eea42cb73c668f3b5d0f7e (patch)
tree31762ea16ad4e7aceb86d3939ebe25839becc77a /tmk_core/common/bootmagic.c
parent497b92c3bd3ee480e59d08f2a6fb1b780172681c (diff)
parent9e01b219f32b0086728c10658928b8bffcc26ef7 (diff)
Merge remote-tracking branch 'jackhumbert/master' into patch-1
Diffstat (limited to 'tmk_core/common/bootmagic.c')
-rw-r--r--tmk_core/common/bootmagic.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c
index 90275a18ba..6730a2a4aa 100644
--- a/tmk_core/common/bootmagic.c
+++ b/tmk_core/common/bootmagic.c
@@ -106,13 +106,15 @@ void bootmagic(void)
}
}
-static bool scan_keycode(uint8_t keycode) {
- for (int8_t r = MATRIX_ROWS - 1; r >= 0; --r) {
+static bool scan_keycode(uint8_t keycode)
+{
+ for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
matrix_row_t matrix_row = matrix_get_row(r);
- for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
- if (matrix_row & (matrix_row_t)1 << c) {
- keypos_t key = (keypos_t){ .row = r, .col = c };
- if (keycode == keymap_key_to_keycode(0, key)) return true;
+ for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+ if (matrix_row & ((matrix_row_t)1<<c)) {
+ if (keycode == keymap_key_to_keycode(0, (keypos_t){ .row = r, .col = c })) {
+ return true;
+ }
}
}
}
@@ -124,4 +126,4 @@ bool bootmagic_scan_keycode(uint8_t keycode)
if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
return scan_keycode(keycode);
-}
+} \ No newline at end of file