#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))
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;
_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);
}
}