aboutsummaryrefslogtreecommitdiff
path: root/keyboards/baguette/baguette.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/baguette/baguette.c')
-rw-r--r--keyboards/baguette/baguette.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/keyboards/baguette/baguette.c b/keyboards/baguette/baguette.c
new file mode 100644
index 000000000..99305cf2d
--- /dev/null
+++ b/keyboards/baguette/baguette.c
@@ -0,0 +1,51 @@
1/* Copyright 2018 Yiancar
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "baguette.h"
17
18void bootmagic_lite(void)
19{
20 // The lite version of TMK's bootmagic made by Wilba.
21 // 100% less potential for accidentally making the
22 // keyboard do stupid things.
23
24 // We need multiple scans because debouncing can't be turned off.
25 matrix_scan();
26 wait_ms(DEBOUNCE);
27 matrix_scan();
28
29 // If the Esc and space bar are held down on power up,
30 // reset the EEPROM valid state and jump to bootloader.
31 // Assumes Esc is at [0,0] and spacebar is at [4,7].
32 // This isn't very generalized, but we need something that doesn't
33 // rely on user's keymaps in firmware or EEPROM.
34 if ( ( matrix_get_row(0) & (1<<0) ) &&
35 ( matrix_get_row(4) & (1<<7) ) )
36 {
37 // Set the TMK/QMK EEPROM state as invalid.
38 eeconfig_disable();
39 //eeprom_set_valid(false);
40 // Jump to bootloader.
41 bootloader_jump();
42 }
43}
44
45void matrix_init_kb(void) {
46 // put your keyboard start-up code here
47 // runs once when the firmware starts up
48 bootmagic_lite();
49
50 matrix_init_user();
51}