diff options
Diffstat (limited to 'protocol')
-rw-r--r-- | protocol/iwrap.mk | 10 | ||||
-rw-r--r-- | protocol/iwrap/iwrap.c | 2 | ||||
-rw-r--r-- | protocol/iwrap/main.c | 110 | ||||
-rw-r--r-- | protocol/lufa/lufa.c | 2 | ||||
-rw-r--r-- | protocol/pjrc/main.c | 2 | ||||
-rw-r--r-- | protocol/pjrc/usb_keyboard.c | 2 | ||||
-rw-r--r-- | protocol/vusb/main.c | 2 | ||||
-rw-r--r-- | protocol/vusb/vusb.c | 14 |
8 files changed, 73 insertions, 71 deletions
diff --git a/protocol/iwrap.mk b/protocol/iwrap.mk index d9906fd1b4..9c83075a4a 100644 --- a/protocol/iwrap.mk +++ b/protocol/iwrap.mk @@ -1,9 +1,11 @@ +IWRAP_DIR = protocol/iwrap + OPT_DEFS += -DHOST_IWRAP -SRC += iwrap.c \ - suart.S \ - sendchar_uart.c \ - uart.c +SRC += $(IWRAP_DIR)/iwrap.c \ + $(IWRAP_DIR)/suart.S \ + $(IWRAP_DIR)/sendchar_uart.c \ + $(IWRAP_DIR)/uart.c # Search Path diff --git a/protocol/iwrap/iwrap.c b/protocol/iwrap/iwrap.c index 9c68761bf0..3cc9ca3061 100644 --- a/protocol/iwrap/iwrap.c +++ b/protocol/iwrap/iwrap.c @@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <string.h> #include <avr/interrupt.h> #include <util/delay.h> -#include "usb_keycodes.h" +#include "keycode.h" #include "suart.h" #include "uart.h" #include "report.h" diff --git a/protocol/iwrap/main.c b/protocol/iwrap/main.c index a552afb67e..c11ff7ab95 100644 --- a/protocol/iwrap/main.c +++ b/protocol/iwrap/main.c @@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "suart.h" #include "timer.h" #include "debug.h" -#include "usb_keycodes.h" +#include "keycode.h" #include "command.h" @@ -166,7 +166,7 @@ int main(void) if (host_get_driver() == vusb_driver()) usbPoll(); #endif - keyboard_proc(); + keyboard_task(); #ifdef HOST_VUSB if (host_get_driver() == vusb_driver()) vusb_transfer_keyboard(); @@ -320,59 +320,59 @@ static uint8_t console_command(uint8_t c) static uint8_t key2asc(uint8_t key) { switch (key) { - case KB_A: return 'a'; - case KB_B: return 'b'; - case KB_C: return 'c'; - case KB_D: return 'd'; - case KB_E: return 'e'; - case KB_F: return 'f'; - case KB_G: return 'g'; - case KB_H: return 'h'; - case KB_I: return 'i'; - case KB_J: return 'j'; - case KB_K: return 'k'; - case KB_L: return 'l'; - case KB_M: return 'm'; - case KB_N: return 'n'; - case KB_O: return 'o'; - case KB_P: return 'p'; - case KB_Q: return 'q'; - case KB_R: return 'r'; - case KB_S: return 's'; - case KB_T: return 't'; - case KB_U: return 'u'; - case KB_V: return 'v'; - case KB_W: return 'w'; - case KB_X: return 'x'; - case KB_Y: return 'y'; - case KB_Z: return 'z'; - case KB_1: return '1'; - case KB_2: return '2'; - case KB_3: return '3'; - case KB_4: return '4'; - case KB_5: return '5'; - case KB_6: return '6'; - case KB_7: return '7'; - case KB_8: return '8'; - case KB_9: return '9'; - case KB_0: return '0'; - case KB_ENTER: return '\n'; - case KB_ESCAPE: return 0x1B; - case KB_BSPACE: return '\b'; - case KB_TAB: return '\t'; - case KB_SPACE: return ' '; - case KB_MINUS: return '-'; - case KB_EQUAL: return '='; - case KB_LBRACKET: return '['; - case KB_RBRACKET: return ']'; - case KB_BSLASH: return '\\'; - case KB_NONUS_HASH: return '\\'; - case KB_SCOLON: return ';'; - case KB_QUOTE: return '\''; - case KB_GRAVE: return '`'; - case KB_COMMA: return ','; - case KB_DOT: return '.'; - case KB_SLASH: return '/'; + case KC_A: return 'a'; + case KC_B: return 'b'; + case KC_C: return 'c'; + case KC_D: return 'd'; + case KC_E: return 'e'; + case KC_F: return 'f'; + case KC_G: return 'g'; + case KC_H: return 'h'; + case KC_I: return 'i'; + case KC_J: return 'j'; + case KC_K: return 'k'; + case KC_L: return 'l'; + case KC_M: return 'm'; + case KC_N: return 'n'; + case KC_O: return 'o'; + case KC_P: return 'p'; + case KC_Q: return 'q'; + case KC_R: return 'r'; + case KC_S: return 's'; + case KC_T: return 't'; + case KC_U: return 'u'; + case KC_V: return 'v'; + case KC_W: return 'w'; + case KC_X: return 'x'; + case KC_Y: return 'y'; + case KC_Z: return 'z'; + case KC_1: return '1'; + case KC_2: return '2'; + case KC_3: return '3'; + case KC_4: return '4'; + case KC_5: return '5'; + case KC_6: return '6'; + case KC_7: return '7'; + case KC_8: return '8'; + case KC_9: return '9'; + case KC_0: return '0'; + case KC_ENTER: return '\n'; + case KC_ESCAPE: return 0x1B; + case KC_BSPACE: return '\b'; + case KC_TAB: return '\t'; + case KC_SPACE: return ' '; + case KC_MINUS: return '-'; + case KC_EQUAL: return '='; + case KC_LBRACKET: return '['; + case KC_RBRACKET: return ']'; + case KC_BSLASH: return '\\'; + case KC_NONUS_HASH: return '\\'; + case KC_SCOLON: return ';'; + case KC_QUOTE: return '\''; + case KC_GRAVE: return '`'; + case KC_COMMA: return ','; + case KC_DOT: return '.'; + case KC_SLASH: return '/'; default: return 0x00; } } diff --git a/protocol/lufa/lufa.c b/protocol/lufa/lufa.c index ff3413227f..bff1f5e8b2 100644 --- a/protocol/lufa/lufa.c +++ b/protocol/lufa/lufa.c @@ -475,7 +475,7 @@ int main(void) keyboard_init(); host_set_driver(&lufa_driver); while (1) { - keyboard_proc(); + keyboard_task(); #if !defined(INTERRUPT_CONTROL_ENDPOINT) USB_USBTask(); diff --git a/protocol/pjrc/main.c b/protocol/pjrc/main.c index 0b0a44028e..e0f600fe7c 100644 --- a/protocol/pjrc/main.c +++ b/protocol/pjrc/main.c @@ -86,6 +86,6 @@ int main(void) host_set_driver(pjrc_driver()); while (1) { - keyboard_proc(); + keyboard_task(); } } diff --git a/protocol/pjrc/usb_keyboard.c b/protocol/pjrc/usb_keyboard.c index e057c77fa1..49b85c179f 100644 --- a/protocol/pjrc/usb_keyboard.c +++ b/protocol/pjrc/usb_keyboard.c @@ -23,7 +23,7 @@ #include <avr/interrupt.h> #include <avr/pgmspace.h> -#include "usb_keycodes.h" +#include "keycode.h" #include "usb_keyboard.h" #include "print.h" #include "debug.h" diff --git a/protocol/vusb/main.c b/protocol/vusb/main.c index 3deb82238a..e964a69a87 100644 --- a/protocol/vusb/main.c +++ b/protocol/vusb/main.c @@ -96,7 +96,7 @@ int main(void) // TODO: configuration process is incosistent. it sometime fails. // To prevent failing to configure NOT scan keyboard during configuration if (usbConfiguration && usbInterruptIsReady()) { - keyboard_proc(); + keyboard_task(); } vusb_transfer_keyboard(); } diff --git a/protocol/vusb/vusb.c b/protocol/vusb/vusb.c index 4e11836e16..1d5f4a8528 100644 --- a/protocol/vusb/vusb.c +++ b/protocol/vusb/vusb.c @@ -42,12 +42,12 @@ void vusb_transfer_keyboard(void) if (usbInterruptIsReady()) { if (kbuf_head != kbuf_tail) { usbSetInterrupt((void *)&kbuf[kbuf_tail], sizeof(report_keyboard_t)); - if (!debug_keyboard) { - print("keys: "); - for (int i = 0; i < REPORT_KEYS; i++) { phex(kbuf[kbuf_tail].keys[i]); print(" "); } - print(" mods: "); phex((kbuf[kbuf_tail]).mods); print("\n"); - } kbuf_tail = (kbuf_tail + 1) % KBUF_SIZE; + if (debug_keyboard) { + print("V-USB: kbuf["); pdec(kbuf_tail); print("->"); pdec(kbuf_head); print("]("); + phex((kbuf_head < kbuf_tail) ? (KBUF_SIZE - kbuf_tail + kbuf_head) : (kbuf_head - kbuf_tail)); + print(")\n"); + } } } } @@ -164,8 +164,8 @@ usbRequest_t *rq = (void *)data; if(rq->bRequest == USBRQ_HID_GET_REPORT){ debug("GET_REPORT:"); /* we only have one report type, so don't look at wValue */ - usbMsgPtr = (void *)keyboard_report_prev; - return sizeof(*keyboard_report_prev); + usbMsgPtr = (void *)keyboard_report; + return sizeof(*keyboard_report); }else if(rq->bRequest == USBRQ_HID_GET_IDLE){ debug("GET_IDLE: "); //debug_hex(vusb_idle_rate); |