X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=common%2Fbootmagic.c;h=388099e2e63acf4d7c84d065514a5d0371134dfe;hb=db79c1160b80a8292014cc50c7f16969d64e9e07;hp=31b8ae5e6207a3bc0d0e9b97a6d8303ad2f44fe7;hpb=4d64fd8faa8b1a0ceb9019446ba6915aaf1812ea;p=tmk_firmware.git diff --git a/common/bootmagic.c b/common/bootmagic.c index 31b8ae5..388099e 100644 --- a/common/bootmagic.c +++ b/common/bootmagic.c @@ -10,12 +10,12 @@ void bootmagic(void) { + if (!BOOTMAGIC_IS_ENABLED()) { return; } + /* do scans in case of bounce */ uint8_t scan = 100; while (scan--) { matrix_scan(); _delay_ms(1); } - if (!BOOTMAGIC_IS_ENABLE()) { return; } - if (bootmagic_scan_keycode(BOOTMAGIC_BOOTLOADER_KEY)) { bootloader_jump(); } @@ -27,6 +27,28 @@ void bootmagic(void) if (bootmagic_scan_keycode(BOOTMAGIC_EEPROM_CLEAR_KEY)) { eeconfig_init(); } + + if (bootmagic_scan_keycode(BOOTMAGIC_SWAP_CONTROL_CPASLOCK)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_SWAP_CONTROL_CAPSLOCK); + } + if (bootmagic_scan_keycode(BOOTMAGIC_CAPSLOCK_TO_CONTROL)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_CAPSLOCK_TO_CONTROL); + } + if (bootmagic_scan_keycode(BOOTMAGIC_SWAP_LALT_LGUI)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_SWAP_LALT_LGUI); + } + if (bootmagic_scan_keycode(BOOTMAGIC_SWAP_RALT_RGUI)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_SWAP_RALT_RGUI); + } + if (bootmagic_scan_keycode(BOOTMAGIC_NO_GUI)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_NO_GUI); + } + if (bootmagic_scan_keycode(BOOTMAGIC_SWAP_GRAVE_ESC)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_SWAP_GRAVE_ESC); + } + if (bootmagic_scan_keycode(BOOTMAGIC_SWAP_BACKSLASH_BACKSPACE)) { + eeconfig_write_keyconf(eeconfig_read_keyconf() ^ EECONFIG_KEYCONF_SWAP_BACKSLASH_BACKSPACE); + } } bool bootmagic_scan_keycode(uint8_t keycode)