]> git.donarmstrong.com Git - tmk_firmware.git/blobdiff - common/bootmagic.c
Merge branch 'ps2_mouse_fix'
[tmk_firmware.git] / common / bootmagic.c
index 11eef3c3c604d205fbbd737ce75fc6dd4cb61eb7..036d49044004156b5f4f313fbdaea81923bef31f 100644 (file)
@@ -5,6 +5,7 @@
 #include "bootloader.h"
 #include "debug.h"
 #include "keymap.h"
+#include "action_layer.h"
 #include "eeconfig.h"
 #include "bootmagic.h"
 
@@ -17,8 +18,10 @@ void bootmagic(void)
     }
 
     /* do scans in case of bounce */
+    print("boogmagic scan: ... ");
     uint8_t scan = 100;
     while (scan--) { matrix_scan(); _delay_ms(10); }
+    print("done.\n");
 
     /* bootmagic skip */
     if (bootmagic_scan_keycode(BOOTMAGIC_KEY_SKIP)) {
@@ -52,7 +55,7 @@ void bootmagic(void)
 
     /* keymap config */
     keymap_config.raw = eeconfig_read_keymap();
-    if (bootmagic_scan_keycode(BOOTMAGIC_KEY_SWAP_CONTROL_CPASLOCK)) {
+    if (bootmagic_scan_keycode(BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK)) {
         keymap_config.swap_control_capslock = !keymap_config.swap_control_capslock;
     }
     if (bootmagic_scan_keycode(BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL)) {
@@ -94,7 +97,7 @@ void bootmagic(void)
     }
 }
 
-bool bootmagic_scan_keycode(uint8_t keycode)
+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);
@@ -108,3 +111,10 @@ bool bootmagic_scan_keycode(uint8_t keycode)
     }
     return false;
 }
+
+bool bootmagic_scan_keycode(uint8_t keycode)
+{
+    if (!scan_keycode(BOOTMAGIC_KEY_SALT)) return false;
+
+    return scan_keycode(keycode);
+}