aboutsummaryrefslogtreecommitdiff
path: root/quantum/via.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-03-21 23:10:39 +0000
committerGitHub <noreply@github.com>2020-03-21 23:10:39 +0000
commit789e19945038c3b98d6e80bc29166d493a8b1056 (patch)
treed3d5159d9390365a2374d72cf61bd9c7ecd37ae0 /quantum/via.c
parenta747c1c3dee728f5124a8effb8f52819f643de5f (diff)
downloadqmk_firmware-789e19945038c3b98d6e80bc29166d493a8b1056.tar.gz
qmk_firmware-789e19945038c3b98d6e80bc29166d493a8b1056.zip
Add support for Bootmagic lite when using SPLIT_HAND_PIN (#8347)
* Add support for Bootmagic lite when using SPLIT_HAND_PIN * Deduplicate bootmagic_lite logic from within via * Revert location of defaults so that user overrides still work for now * Tidy up code slightly
Diffstat (limited to 'quantum/via.c')
-rw-r--r--quantum/via.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/quantum/via.c b/quantum/via.c
index f85af8d9e..288299ada 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -92,36 +92,6 @@ void via_eeprom_reset(void) {
92 eeconfig_disable(); 92 eeconfig_disable();
93} 93}
94 94
95// Override bootmagic_lite() so it can flag EEPROM as invalid
96// as well as jump to bootloader, thus performing a "factory reset"
97// of dynamic keymaps and optionally backlight/other settings.
98void bootmagic_lite(void) {
99 // The lite version of TMK's bootmagic based on Wilba.
100 // 100% less potential for accidentally making the
101 // keyboard do stupid things.
102
103 // We need multiple scans because debouncing can't be turned off.
104 matrix_scan();
105#if defined(DEBOUNCE) && DEBOUNCE > 0
106 wait_ms(DEBOUNCE * 2);
107#else
108 wait_ms(30);
109#endif
110 matrix_scan();
111
112 // If the Esc and space bar are held down on power up,
113 // reset the EEPROM valid state and jump to bootloader.
114 // Assumes Esc is at [0,0].
115 // This isn't very generalized, but we need something that doesn't
116 // rely on user's keymaps in firmware or EEPROM.
117 if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
118 // This is the only difference from the default implementation.
119 via_eeprom_reset();
120 // Jump to bootloader.
121 bootloader_jump();
122 }
123}
124
125// Override this at the keyboard code level to check 95// Override this at the keyboard code level to check
126// VIA's EEPROM valid state and reset to defaults as needed. 96// VIA's EEPROM valid state and reset to defaults as needed.
127// Used by keyboards that store their own state in EEPROM, 97// Used by keyboards that store their own state in EEPROM,