summaryrefslogtreecommitdiff
path: root/tmk.c
diff options
context:
space:
mode:
authortmk <nobody@nowhere>2010-10-24 03:27:43 +0900
committertmk <nobody@nowhere>2010-10-24 03:33:08 +0900
commit4acc38751e9c8e90921773e6e5f5a100b0729d98 (patch)
treee8e650c6c0557871f55c39b6449a0cc2479fbf58 /tmk.c
parentbf92bdd7fa9938c162c29e565d245e5609e4a912 (diff)
switch debug on/off by pressing 4 keys on booting time
Diffstat (limited to 'tmk.c')
-rw-r--r--tmk.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/tmk.c b/tmk.c
index cd52d318e6..54b02fcbc9 100644
--- a/tmk.c
+++ b/tmk.c
@@ -63,18 +63,6 @@ int main(void)
usb_init();
while (!usb_configured()) /* wait */ ;
- // Wait an extra second for the PC's operating system to load drivers
- // and do whatever it does to actually be ready for input
- // needs such long time in my PC.
- /* wait for debug print. no need for normal use */
- for (int i =0; i < 6; i++) {
- LED_CONFIG;
- LED_ON;
- _delay_ms(500);
- LED_OFF;
- _delay_ms(500);
- }
-
// Configure timer 0 to generate a timer overflow interrupt every
// 256*1024 clock cycles, or approx 61 Hz when using 16 MHz clock
// This demonstrates how to use interrupts to implement a simple
@@ -85,6 +73,20 @@ int main(void)
matrix_init();
+ matrix_scan();
+ // debug on when 4 keys are pressed
+ if (matrix_key_count() == 4) print_enable = true;
+
+ /* wait for debug pipe to print greetings. */
+ if (print_enable) {
+ for (int i =0; i < 6; i++) {
+ LED_CONFIG;
+ LED_ON;
+ _delay_ms(500);
+ LED_OFF;
+ _delay_ms(500);
+ }
+ }
print("\nt.m.k. keyboard 1.2\n");
while (1) {
proc_matrix();