summaryrefslogtreecommitdiff
path: root/tinyusb/class/hid_host.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-04-26 02:08:22 +0700
committerhathach <[email protected]>2013-04-26 02:08:22 +0700
commit33feba5cbc7a344f1bac67508e5658aa615e59bf (patch)
treea3833f483fa7d49af0b23799b9c1731a3733b9d0 /tinyusb/class/hid_host.c
parentc0104b996e9ea0c5c25861ccf24e0255431a8f9c (diff)
add hid_keycode_to_ascii_tbl for hid class
improve keyboard_app, should display all displayable characters improve the de-bouncing keyboard (still got some issues)
Diffstat (limited to 'tinyusb/class/hid_host.c')
-rw-r--r--tinyusb/class/hid_host.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tinyusb/class/hid_host.c b/tinyusb/class/hid_host.c
index 412465b5b..3d6683404 100644
--- a/tinyusb/class/hid_host.c
+++ b/tinyusb/class/hid_host.c
@@ -111,6 +111,16 @@ tusb_error_t hidh_interface_get_report(uint8_t dev_addr, uint8_t * const report,
//--------------------------------------------------------------------+
#if TUSB_CFG_HOST_HID_KEYBOARD
+#define EXPAND_KEYCODE_TO_ASCII(keycode, ascii, shift_modified) \
+ [0][keycode] = ascii,\
+ [1][keycode] = shift_modified,\
+
+// TODO size of table should be a macro for application to check boundary
+uint8_t const hid_keycode_to_ascii_tbl[2][128] =
+{
+ HID_KEYCODE_TABLE(EXPAND_KEYCODE_TO_ASCII)
+};
+
STATIC_ hidh_interface_info_t keyboard_data[TUSB_CFG_HOST_DEVICE_MAX]; // does not have addr0, index = dev_address-1
//------------- KEYBOARD PUBLIC API (parameter validation required) -------------//