diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-10-27 11:53:50 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2018-10-27 14:53:50 -0400 |
| commit | 4ffcacd92086870eb7a3102d54178a7af64edb0c (patch) | |
| tree | b30479a70abc0d0dcd6c287383eb64e8f2fee104 /quantum/quantum.c | |
| parent | 5be438f03d0ae3ebdb9e24d249fdfd7f5c573634 (diff) | |
| download | qmk_firmware-4ffcacd92086870eb7a3102d54178a7af64edb0c.tar.gz qmk_firmware-4ffcacd92086870eb7a3102d54178a7af64edb0c.zip | |
Add Bootmagic Lite to QMK (#4215)
* Preliminary additon of bootmagic lite functionality
* Cleanup code
* Clean up bootmagic code
* Add documentation and clean up code
* Make 'lite' an option for BOOTMAGIC_ENABLE
* Update Templates with note about Bootmagic Lite option
* Detect Debounce variable
* Make sure debounce is a non-zero number
* Capitalize Bootmagic
* Capitalize bootmagic
* Update wording
* Re-add EEPROM reset, by popular demand
And add eeprom-less version to drashna userspace for his sanity
* Fix spacing
* Set BOOTMAGIC_ENABLE to use full/lite/off
And default yes to "full" for compatibility
* Add Bootmagic lite info to templates
* Remove text from makefiles
* Cleanup of makefile
* mention yes in bootmagic docs
* Wordsmitthing the docs
* Fix white spaces
* Readd default bootmagic setting, because it's necessary
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 |
