#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();
- // debug on by pressing down any 4 or more keys during boot time.
- if (matrix_key_count() >= 4) {
- print_enable = true;
- debug_enable = true;
- }
-
- /* wait for debug pipe ready */
- if (print_enable) {
+ if (matrix_key_count() >= 3) {
#ifdef DEBUG_LED
for (int i = 0; i < 6; i++) {
DEBUG_LED_CONFIG;
_delay_ms(500);
}
#else
- _delay_ms(6000);
+ _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
}
- // print description
- print(STR(DESCRIPTION) "\n");
+
+#ifdef PS2_MOUSE_ENABLE
+ ps2_host_init();
+ ps2_mouse_init();
+#endif
while (1) {
proc_matrix();
- _delay_ms(2);
}
}