diff options
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index c9bec6740..5f1a691c8 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -949,8 +949,40 @@ void tap_random_base64(void) { | |||
| 949 | } | 949 | } |
| 950 | } | 950 | } |
| 951 | 951 | ||
| 952 | __attribute__((weak)) | ||
| 953 | void bootmagic_lite(void) { | ||
| 954 | // The lite version of TMK's bootmagic based on Wilba. | ||
| 955 | // 100% less potential for accidentally making the | ||
| 956 | // keyboard do stupid things. | ||
| 957 | |||
| 958 | // We need multiple scans because debouncing can't be turned off. | ||
| 959 | matrix_scan(); | ||
| 960 | #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 | ||
| 961 | wait_ms(DEBOUNCING_DELAY * 2); | ||
| 962 | #elif defined(DEBOUNCE) && DEBOUNCE > 0 | ||
| 963 | wait_ms(DEBOUNCE * 2); | ||
| 964 | #else | ||
| 965 | wait_ms(30); | ||
| 966 | #endif | ||
| 967 | matrix_scan(); | ||
| 968 | |||
| 969 | // If the Esc and space bar are held down on power up, | ||
| 970 | // reset the EEPROM valid state and jump to bootloader. | ||
| 971 | // Assumes Esc is at [0,0]. | ||
| 972 | // This isn't very generalized, but we need something that doesn't | ||
| 973 | // rely on user's keymaps in firmware or EEPROM. | ||
| 974 | if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { | ||
| 975 | eeconfig_disable(); | ||
| 976 | // Jump to bootloader. | ||
| 977 | bootloader_jump(); | ||
| 978 | } | ||
| 979 | } | ||
| 980 | |||
| 952 | void matrix_init_quantum() { | 981 | void matrix_init_quantum() { |
| 953 | if (!eeconfig_is_enabled() && !eeconfig_is_disabled()) { | 982 | #ifdef BOOTMAGIC_LITE |
| 983 | bootmagic_lite(); | ||
| 984 | #endif | ||
| 985 | if (!eeconfig_is_enabled()) { | ||
| 954 | eeconfig_init(); | 986 | eeconfig_init(); |
| 955 | } | 987 | } |
| 956 | #ifdef BACKLIGHT_ENABLE | 988 | #ifdef BACKLIGHT_ENABLE |
