aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/common/bootmagic_lite.c
diff options
context:
space:
mode:
Diffstat (limited to 'tmk_core/common/bootmagic_lite.c')
-rw-r--r--tmk_core/common/bootmagic_lite.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/tmk_core/common/bootmagic_lite.c b/tmk_core/common/bootmagic_lite.c
deleted file mode 100644
index cbf756a17..000000000
--- a/tmk_core/common/bootmagic_lite.c
+++ /dev/null
@@ -1,49 +0,0 @@
1#include "quantum.h"
2
3/** \brief Reset eeprom
4 *
5 * ...just incase someone wants to only change the eeprom behaviour
6 */
7__attribute__((weak)) void bootmagic_lite_reset_eeprom(void) {
8#if defined(VIA_ENABLE)
9 via_eeprom_reset();
10#else
11 eeconfig_disable();
12#endif
13}
14
15/** \brief The lite version of TMK's bootmagic based on Wilba.
16 *
17 * 100% less potential for accidentally making the keyboard do stupid things.
18 */
19__attribute__((weak)) void bootmagic_lite(void) {
20 // We need multiple scans because debouncing can't be turned off.
21 matrix_scan();
22#if defined(DEBOUNCE) && DEBOUNCE > 0
23 wait_ms(DEBOUNCE * 2);
24#else
25 wait_ms(30);
26#endif
27 matrix_scan();
28
29 // If the configured key (commonly Esc) is held down on power up,
30 // reset the EEPROM valid state and jump to bootloader.
31 // This isn't very generalized, but we need something that doesn't
32 // rely on user's keymaps in firmware or EEPROM.
33 uint8_t row = BOOTMAGIC_LITE_ROW;
34 uint8_t col = BOOTMAGIC_LITE_COLUMN;
35
36#if defined(SPLIT_KEYBOARD) && defined(BOOTMAGIC_LITE_ROW_RIGHT) && defined(BOOTMAGIC_LITE_COLUMN_RIGHT)
37 if (!is_keyboard_left()) {
38 row = BOOTMAGIC_LITE_ROW_RIGHT;
39 col = BOOTMAGIC_LITE_COLUMN_RIGHT;
40 }
41#endif
42
43 if (matrix_get_row(row) & (1 << col)) {
44 bootmagic_lite_reset_eeprom();
45
46 // Jump to bootloader.
47 bootloader_jump();
48 }
49}