diff options
author | Balz Guenat <balz.guenat@gmail.com> | 2017-08-12 18:24:15 +0200 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2017-08-15 23:14:41 -0400 |
commit | 2aa5e4464010a9292b50571243d8ef6e749a5ca4 (patch) | |
tree | 81a485c561b87fbc5e4a43b7273fa631a6c8af99 /tmk_core | |
parent | 42f895a4bc232515d95d1fb93396ecd2c0032c0e (diff) |
some major steps toward making the usb-usb converter work
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common/keycode.h | 8 | ||||
-rw-r--r-- | tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/README.md (renamed from tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/readme.md) | 0 | ||||
-rw-r--r-- | tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/README.md (renamed from tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/readme.md) | 0 | ||||
-rw-r--r-- | tmk_core/protocol/usb_hid/parser.cpp | 24 | ||||
-rw-r--r-- | tmk_core/protocol/usb_hid/parser.h | 5 | ||||
-rw-r--r-- | tmk_core/protocol/usb_hid/test/Makefile | 40 |
6 files changed, 55 insertions, 22 deletions
diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 54e9c322c1..a1e0bc9a47 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -94,6 +94,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define KC_JYEN KC_INT3 #define KC_HENK KC_INT4 #define KC_MHEN KC_INT5 +/* Korean specific */ +#define KC_HAEN KC_LANG1 +#define KC_HANJ KC_LANG2 /* Keypad */ #define KC_P1 KC_KP_1 #define KC_P2 KC_KP_2 @@ -113,6 +116,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define KC_PPLS KC_KP_PLUS #define KC_PEQL KC_KP_EQUAL #define KC_PENT KC_KP_ENTER +/* Unix function key */ +#define KC_EXEC KC_EXECUTE +#define KC_SLCT KC_SELECT +#define KC_AGIN KC_AGAIN +#define KC_PSTE KC_PASTE /* Mousekey */ #define KC_MS_U KC_MS_UP #define KC_MS_D KC_MS_DOWN diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/readme.md b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/README.md index 49cd83e0af..49cd83e0af 100644 --- a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/readme.md +++ b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/README.md diff --git a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/readme.md b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/README.md index d8b4296b1a..d8b4296b1a 100644 --- a/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/readme.md +++ b/tmk_core/protocol/usb_hid/USB_Host_Shield_2.0/examples/testusbhostFAT/README.md diff --git a/tmk_core/protocol/usb_hid/parser.cpp b/tmk_core/protocol/usb_hid/parser.cpp index 1a152ff3f2..94e747ca4b 100644 --- a/tmk_core/protocol/usb_hid/parser.cpp +++ b/tmk_core/protocol/usb_hid/parser.cpp @@ -4,30 +4,14 @@ #include "debug.h" -report_keyboard_t usb_hid_keyboard_report; -uint16_t usb_hid_time_stamp; - - void KBDReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) { - bool is_error = false; - report_keyboard_t *report = (report_keyboard_t *)buf; + ::memcpy(&report, buf, sizeof(report_keyboard_t)); + time_stamp = millis(); - dprintf("KBDReport: %02X %02X", report->mods, report->reserved); + dprintf("input %d: %02X %02X", hid->GetAddress(), report.mods, report.reserved); for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { - if (IS_ERROR(report->keys[i])) { - is_error = true; - } - dprintf(" %02X", report->keys[i]); + dprintf(" %02X", report.keys[i]); } dprint("\r\n"); - - // ignore error and not send report to computer - if (is_error) { - dprint("Error usage! \r\n"); - return; - } - - ::memcpy(&usb_hid_keyboard_report, buf, sizeof(report_keyboard_t)); - usb_hid_time_stamp = millis(); } diff --git a/tmk_core/protocol/usb_hid/parser.h b/tmk_core/protocol/usb_hid/parser.h index 703eb1ed4c..036281fa66 100644 --- a/tmk_core/protocol/usb_hid/parser.h +++ b/tmk_core/protocol/usb_hid/parser.h @@ -2,11 +2,14 @@ #define PARSER_H #include "hid.h" +#include "report.h" class KBDReportParser : public HIDReportParser { public: - virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); + report_keyboard_t report; + uint16_t time_stamp; + virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); }; #endif diff --git a/tmk_core/protocol/usb_hid/test/Makefile b/tmk_core/protocol/usb_hid/test/Makefile index c093bbd4c1..83bf2aed67 100644 --- a/tmk_core/protocol/usb_hid/test/Makefile +++ b/tmk_core/protocol/usb_hid/test/Makefile @@ -1,4 +1,42 @@ - +#---------------------------------------------------------------------------- +# On command line: +# +# make all = Make software. +# +# make clean = Clean out built project files. +# +# make coff = Convert ELF to AVR COFF. +# +# make extcoff = Convert ELF to AVR Extended COFF. +# +# make program = Download the hex file to the device. +# Please customize your programmer settings(PROGRAM_CMD) +# +# make teensy = Download the hex file to the device, using teensy_loader_cli. +# (must have teensy_loader_cli installed). +# +# make dfu = Download the hex file to the device, using dfu-programmer (must +# have dfu-programmer installed). +# +# make flip = Download the hex file to the device, using Atmel FLIP (must +# have Atmel FLIP installed). +# +# make dfu-ee = Download the eeprom file to the device, using dfu-programmer +# (must have dfu-programmer installed). +# +# make flip-ee = Download the eeprom file to the device, using Atmel FLIP +# (must have Atmel FLIP installed). +# +# make debug = Start either simulavr or avarice as specified for debugging, +# with avr-gdb or avr-insight as the front end for debugging. +# +# make filename.s = Just compile filename.c into the assembler code only. +# +# make filename.i = Create a preprocessed source file for use in submitting +# bug reports to the GCC project. +# +# To rebuild project do "make clean" then "make all". +#---------------------------------------------------------------------------- # Target file name (without extension). TARGET = usb_hid_test |