diff options
| author | tmk <nobody@nowhere> | 2013-03-09 11:22:27 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2013-03-09 11:22:27 +0900 |
| commit | 4d64fd8faa8b1a0ceb9019446ba6915aaf1812ea (patch) | |
| tree | 25410ede4bbf7d5a8994bb385e6c7ee4ad2f4c0c /common/keyboard.c | |
| parent | 359b68d35f0763ab0cafa2fb800e0a3497291f95 (diff) | |
| download | qmk_firmware-4d64fd8faa8b1a0ceb9019446ba6915aaf1812ea.tar.gz qmk_firmware-4d64fd8faa8b1a0ceb9019446ba6915aaf1812ea.zip | |
Add bootmagic.c and fix bootloader_jump
Diffstat (limited to 'common/keyboard.c')
| -rw-r--r-- | common/keyboard.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/common/keyboard.c b/common/keyboard.c index 2206f1675..0a0bacd43 100644 --- a/common/keyboard.c +++ b/common/keyboard.c | |||
| @@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 28 | #include "command.h" | 28 | #include "command.h" |
| 29 | #include "util.h" | 29 | #include "util.h" |
| 30 | #include "sendchar.h" | 30 | #include "sendchar.h" |
| 31 | #include "bootloader.h" | 31 | #include "bootmagic.h" |
| 32 | #ifdef MOUSEKEY_ENABLE | 32 | #ifdef MOUSEKEY_ENABLE |
| 33 | #include "mousekey.h" | 33 | #include "mousekey.h" |
| 34 | #endif | 34 | #endif |
| @@ -64,27 +64,7 @@ void keyboard_init(void) | |||
| 64 | ps2_mouse_init(); | 64 | ps2_mouse_init(); |
| 65 | #endif | 65 | #endif |
| 66 | 66 | ||
| 67 | /* matrix scan for boot magic keys */ | 67 | bootmagic(); |
| 68 | #ifdef DEBOUNCE | ||
| 69 | uint8_t scan = DEBOUNCE * 2; | ||
| 70 | while (scan--) { matrix_scan(); _delay_ms(1); } | ||
| 71 | #else | ||
| 72 | matrix_scan(); | ||
| 73 | #endif | ||
| 74 | |||
| 75 | /* boot magic keys */ | ||
| 76 | #ifdef IS_BOOTMAGIC_BOOTLOADER | ||
| 77 | /* kick up bootloader */ | ||
| 78 | if (IS_BOOTMAGIC_BOOTLOADER()) bootloader_jump(); | ||
| 79 | #endif | ||
| 80 | #ifdef IS_BOOTMAGIC_DEBUG | ||
| 81 | if (IS_BOOTMAGIC_DEBUG()) { | ||
| 82 | eeconfig_write_debug(eeconfig_read_debug() ^ EECONFIG_DEBUG_ENABLE); | ||
| 83 | } | ||
| 84 | #endif | ||
| 85 | #ifdef IS_BOOTMAGIC_EEPROM_CLEAR | ||
| 86 | if (IS_BOOTMAGIC_EEPROM_CLEAR()) eeconfig_init(); | ||
| 87 | #endif | ||
| 88 | 68 | ||
| 89 | if (eeconfig_initialized()) { | 69 | if (eeconfig_initialized()) { |
| 90 | uint8_t config; | 70 | uint8_t config; |
| @@ -96,7 +76,6 @@ void keyboard_init(void) | |||
| 96 | } else { | 76 | } else { |
| 97 | eeconfig_init(); | 77 | eeconfig_init(); |
| 98 | } | 78 | } |
| 99 | |||
| 100 | } | 79 | } |
| 101 | 80 | ||
| 102 | /* | 81 | /* |
