From 4ae979f6ef8dbf9e1d1f35be15322ad6d02e2958 Mon Sep 17 00:00:00 2001 From: tmk Date: Sat, 6 Oct 2012 02:23:12 +0900 Subject: Initial version of new code for layer switch is added. --- protocol/lufa/lufa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'protocol') 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(); -- cgit v1.2.3 From c845fd078c8a8e38e66f625f669a34aa2400d63b Mon Sep 17 00:00:00 2001 From: tmk Date: Sun, 7 Oct 2012 11:09:40 +0900 Subject: changes function name keyboard_proc to keyboard_task --- protocol/iwrap/main.c | 2 +- protocol/pjrc/main.c | 2 +- protocol/vusb/main.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'protocol') diff --git a/protocol/iwrap/main.c b/protocol/iwrap/main.c index a552afb67e..5c42a2c6ad 100644 --- a/protocol/iwrap/main.c +++ b/protocol/iwrap/main.c @@ -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(); 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/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(); } -- cgit v1.2.3 From 71ac82337f803e8ec0c081b3221ac0ccf61035b0 Mon Sep 17 00:00:00 2001 From: tmk Date: Tue, 9 Oct 2012 16:50:14 +0900 Subject: Clean host.h interface. --- protocol/vusb/vusb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocol') diff --git a/protocol/vusb/vusb.c b/protocol/vusb/vusb.c index 4e11836e16..59834e6918 100644 --- a/protocol/vusb/vusb.c +++ b/protocol/vusb/vusb.c @@ -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); -- cgit v1.2.3 From 30eb3e3520e9d4d7b9a9dbac0c5c0200485103c2 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 17 Oct 2012 03:44:01 +0900 Subject: Add command console and mouseky parameters tweak. --- protocol/vusb/vusb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'protocol') diff --git a/protocol/vusb/vusb.c b/protocol/vusb/vusb.c index 59834e6918..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"); + } } } } -- cgit v1.2.3 From 8570c25379e168874fb4cdc7ee0590829a0f0d2c Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 17 Oct 2012 14:25:08 +0900 Subject: Fix HHKB iWRAP build --- protocol/iwrap.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocol') 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 -- cgit v1.2.3 From ce2e06c39465b76a1780e5d594eaea7697afafd6 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 17 Oct 2012 21:43:44 +0900 Subject: Fix projects for new keycodes --- protocol/iwrap/iwrap.c | 2 +- protocol/iwrap/main.c | 108 +++++++++++++++++++++---------------------- protocol/pjrc/usb_keyboard.c | 2 +- 3 files changed, 56 insertions(+), 56 deletions(-) (limited to 'protocol') 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 . #include #include #include -#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 5c42a2c6ad..c11ff7ab95 100644 --- a/protocol/iwrap/main.c +++ b/protocol/iwrap/main.c @@ -34,7 +34,7 @@ along with this program. If not, see . #include "suart.h" #include "timer.h" #include "debug.h" -#include "usb_keycodes.h" +#include "keycode.h" #include "command.h" @@ -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/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 #include -#include "usb_keycodes.h" +#include "keycode.h" #include "usb_keyboard.h" #include "print.h" #include "debug.h" -- cgit v1.2.3