diff options
Diffstat (limited to 'common/keyboard.c')
| -rw-r--r-- | common/keyboard.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/common/keyboard.c b/common/keyboard.c index 91f321d9c..2206f1675 100644 --- a/common/keyboard.c +++ b/common/keyboard.c | |||
| @@ -32,6 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 32 | #ifdef MOUSEKEY_ENABLE | 32 | #ifdef MOUSEKEY_ENABLE |
| 33 | #include "mousekey.h" | 33 | #include "mousekey.h" |
| 34 | #endif | 34 | #endif |
| 35 | #include "eeconfig.h" | ||
| 35 | 36 | ||
| 36 | 37 | ||
| 37 | #ifdef MATRIX_HAS_GHOST | 38 | #ifdef MATRIX_HAS_GHOST |
| @@ -59,6 +60,9 @@ void keyboard_init(void) | |||
| 59 | 60 | ||
| 60 | timer_init(); | 61 | timer_init(); |
| 61 | matrix_init(); | 62 | matrix_init(); |
| 63 | #ifdef PS2_MOUSE_ENABLE | ||
| 64 | ps2_mouse_init(); | ||
| 65 | #endif | ||
| 62 | 66 | ||
| 63 | /* matrix scan for boot magic keys */ | 67 | /* matrix scan for boot magic keys */ |
| 64 | #ifdef DEBOUNCE | 68 | #ifdef DEBOUNCE |
| @@ -74,12 +78,25 @@ void keyboard_init(void) | |||
| 74 | if (IS_BOOTMAGIC_BOOTLOADER()) bootloader_jump(); | 78 | if (IS_BOOTMAGIC_BOOTLOADER()) bootloader_jump(); |
| 75 | #endif | 79 | #endif |
| 76 | #ifdef IS_BOOTMAGIC_DEBUG | 80 | #ifdef IS_BOOTMAGIC_DEBUG |
| 77 | if (IS_BOOTMAGIC_DEBUG()) debug_enable = true; | 81 | if (IS_BOOTMAGIC_DEBUG()) { |
| 82 | eeconfig_write_debug(eeconfig_read_debug() ^ EECONFIG_DEBUG_ENABLE); | ||
| 83 | } | ||
| 78 | #endif | 84 | #endif |
| 79 | 85 | #ifdef IS_BOOTMAGIC_EEPROM_CLEAR | |
| 80 | #ifdef PS2_MOUSE_ENABLE | 86 | if (IS_BOOTMAGIC_EEPROM_CLEAR()) eeconfig_init(); |
| 81 | ps2_mouse_init(); | ||
| 82 | #endif | 87 | #endif |
| 88 | |||
| 89 | if (eeconfig_initialized()) { | ||
| 90 | uint8_t config; | ||
| 91 | config = eeconfig_read_debug(); | ||
| 92 | debug_enable = (config & EECONFIG_DEBUG_ENABLE); | ||
| 93 | debug_matrix = (config & EECONFIG_DEBUG_MATRIX); | ||
| 94 | debug_keyboard = (config & EECONFIG_DEBUG_KEYBOARD); | ||
| 95 | debug_mouse = (config & EECONFIG_DEBUG_MOUSE); | ||
| 96 | } else { | ||
| 97 | eeconfig_init(); | ||
| 98 | } | ||
| 99 | |||
| 83 | } | 100 | } |
| 84 | 101 | ||
| 85 | /* | 102 | /* |
