diff options
| author | tmk <nobody@nowhere> | 2012-09-04 13:29:21 +0900 |
|---|---|---|
| committer | tmk <nobody@nowhere> | 2012-09-04 13:29:21 +0900 |
| commit | 232ab308e358e41f3253d66fa009c1ebca0951a2 (patch) | |
| tree | 737827112555c00a7f2ebbb88e61079c460be71a /converter/usb_usb/main.cpp | |
| parent | c77c5043a121f195b3a552feb8283424a0652ce2 (diff) | |
| download | qmk_firmware-232ab308e358e41f3253d66fa009c1ebca0951a2.tar.gz qmk_firmware-232ab308e358e41f3253d66fa009c1ebca0951a2.zip | |
usb_hid: workaround for compile on Windows.
Diffstat (limited to 'converter/usb_usb/main.cpp')
| -rw-r--r-- | converter/usb_usb/main.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/converter/usb_usb/main.cpp b/converter/usb_usb/main.cpp index 00d2d59b6..04d838f57 100644 --- a/converter/usb_usb/main.cpp +++ b/converter/usb_usb/main.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | #include <avr/wdt.h> | 2 | #include <avr/wdt.h> |
| 3 | #include <avr/power.h> | 3 | #include <avr/power.h> |
| 4 | #include <util/delay.h> | 4 | #include <util/delay.h> |
| 5 | #include <Arduino.h> | ||
| 6 | 5 | ||
| 7 | // USB HID host | 6 | // USB HID host |
| 8 | #include "Usb.h" | 7 | #include "Usb.h" |
| @@ -13,6 +12,7 @@ | |||
| 13 | // LUFA | 12 | // LUFA |
| 14 | #include "lufa.h" | 13 | #include "lufa.h" |
| 15 | 14 | ||
| 15 | #include "timer.h" | ||
| 16 | #include "debug.h" | 16 | #include "debug.h" |
| 17 | #include "keyboard.h" | 17 | #include "keyboard.h" |
| 18 | 18 | ||
| @@ -71,19 +71,31 @@ int main(void) | |||
| 71 | LUFA_setup(); | 71 | LUFA_setup(); |
| 72 | sei(); | 72 | sei(); |
| 73 | 73 | ||
| 74 | uint8_t ret; | ||
| 74 | // wait for startup of sendchar routine | 75 | // wait for startup of sendchar routine |
| 75 | while (USB_DeviceState != DEVICE_STATE_Configured) ; | 76 | while (USB_DeviceState != DEVICE_STATE_Configured) ; |
| 76 | if (debug_enable) { | 77 | if (debug_enable) { |
| 77 | _delay_ms(1000); | 78 | _delay_ms(1000); |
| 78 | } | 79 | } |
| 79 | 80 | ||
| 81 | debug("init: start\n"); | ||
| 80 | HID_setup(); | 82 | HID_setup(); |
| 81 | 83 | ||
| 82 | debug("init: done\n"); | 84 | debug("init: done\n"); |
| 85 | |||
| 86 | uint16_t timer; | ||
| 87 | // to see loop pulse with oscillo scope | ||
| 88 | DDRF = (1<<7); | ||
| 83 | for (;;) { | 89 | for (;;) { |
| 90 | PORTF ^= (1<<7); | ||
| 84 | keyboard_proc(); | 91 | keyboard_proc(); |
| 85 | 92 | ||
| 93 | timer = timer_read(); | ||
| 86 | usb_host.Task(); | 94 | usb_host.Task(); |
| 95 | timer = timer_elapsed(timer); | ||
| 96 | if (timer > 100) { | ||
| 97 | debug("host.Task: "); debug_hex16(timer); debug("\n"); | ||
| 98 | } | ||
| 87 | 99 | ||
| 88 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) | 100 | #if !defined(INTERRUPT_CONTROL_ENDPOINT) |
| 89 | // LUFA Task for control request | 101 | // LUFA Task for control request |
