X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=tmk.c;h=2248a7d71296d2be2c2ca09f2f14a63b995bc5fd;hb=16be8346175046582b6607a66194cb154d067fb0;hp=f7042bd6fbe2754267d8d48e0c41c72f4c7be1b1;hpb=9019c901dd7b4e37006eb1f0442a57dacc0b3f0c;p=max%2Ftmk_keyboard.git diff --git a/tmk.c b/tmk.c index f7042bd6..2248a7d7 100644 --- a/tmk.c +++ b/tmk.c @@ -34,9 +34,12 @@ #include "print.h" #include "debug.h" #include "util.h" -#include "controller.h" #include "timer.h" #include "jump_bootloader.h" +#ifdef PS2_MOUSE_ENABLE +# include "ps2.h" +# include "ps2_mouse.h" +#endif #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) @@ -66,8 +69,7 @@ int main(void) matrix_init(); matrix_scan(); - // bootloader comes up when any 4 or more keys are pressed at startup - if (matrix_key_count() >= 4) { + if (matrix_key_count() >= 3) { #ifdef DEBUG_LED for (int i = 0; i < 6; i++) { DEBUG_LED_CONFIG; @@ -80,13 +82,24 @@ int main(void) _delay_ms(5000); #endif print_enable = true; + debug_enable = true; + debug_matrix = true; + debug_keyboard = true; + debug_mouse = true; + print("debug enabled.\n"); + } + if (matrix_key_count() >= 4) { print("jump to bootloader...\n"); _delay_ms(1000); jump_bootloader(); // not return } +#ifdef PS2_MOUSE_ENABLE + ps2_host_init(); + ps2_mouse_init(); +#endif + while (1) { proc_matrix(); - _delay_ms(2); } }