diff options
Diffstat (limited to 'keyboards/wilba_tech/wt_main.c')
| -rw-r--r-- | keyboards/wilba_tech/wt_main.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c new file mode 100644 index 000000000..f514dbefc --- /dev/null +++ b/keyboards/wilba_tech/wt_main.c | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /* Copyright 2018 Jason Williams (Wilba) | ||
| 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 | |||
| 17 | #include "quantum.h" | ||
| 18 | #include "keyboards/wilba_tech/wt_mono_backlight.h" | ||
| 19 | |||
| 20 | void bootmagic_lite(void) | ||
| 21 | { | ||
| 22 | // The lite version of TMK's bootmagic. | ||
| 23 | // 100% less potential for accidentally making the | ||
| 24 | // keyboard do stupid things. | ||
| 25 | |||
| 26 | // We need multiple scans because debouncing can't be turned off. | ||
| 27 | matrix_scan(); | ||
| 28 | wait_ms(DEBOUNCING_DELAY); | ||
| 29 | wait_ms(DEBOUNCING_DELAY); | ||
| 30 | matrix_scan(); | ||
| 31 | |||
| 32 | // If the Esc (matrix 0,0) is held down on power up, | ||
| 33 | // reset the EEPROM valid state and jump to bootloader. | ||
| 34 | if ( matrix_get_row(0) & (1<<0) ) { | ||
| 35 | // Set the TMK/QMK EEPROM state as invalid. | ||
| 36 | eeconfig_disable(); | ||
| 37 | // Jump to bootloader. | ||
| 38 | bootloader_jump(); | ||
| 39 | } | ||
| 40 | } | ||
| 41 | |||
| 42 | void matrix_init_kb(void) | ||
| 43 | { | ||
| 44 | bootmagic_lite(); | ||
| 45 | backlight_init_drivers(); | ||
| 46 | backlight_timer_init(); | ||
| 47 | backlight_timer_enable(); | ||
| 48 | matrix_init_user(); | ||
| 49 | } | ||
| 50 | |||
| 51 | void matrix_scan_kb(void) | ||
| 52 | { | ||
| 53 | backlight_update_pwm_buffers(); | ||
| 54 | matrix_scan_user(); | ||
| 55 | } | ||
