3 #include <util/delay.h>
7 #include "bootloader.h"
13 /* do scans in case of bounce */
15 while (scan--) { matrix_scan(); _delay_ms(1); }
17 if (!BOOTMAGIC_IS_ENABLE()) { return; }
19 if (bootmagic_scan_keycode(BOOTMAGIC_BOOTLOADER_KEY)) {
23 if (bootmagic_scan_keycode(BOOTMAGIC_DEBUG_ENABLE_KEY)) {
24 eeconfig_write_debug(eeconfig_read_debug() ^ EECONFIG_DEBUG_ENABLE);
27 if (bootmagic_scan_keycode(BOOTMAGIC_EEPROM_CLEAR_KEY)) {
32 bool bootmagic_scan_keycode(uint8_t keycode)
34 for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
35 matrix_row_t matrix_row = matrix_get_row(r);
36 for (uint8_t c = 0; c < MATRIX_COLS; c++) {
37 if (matrix_row & ((matrix_row_t)1<<c)) {
38 if (keycode == keymap_key_to_keycode(0, (key_t){ .row = r, .col = c })) {