mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-18 21:41:12 +00:00
refine keyboard host demo (added new line for enter key)
This commit is contained in:
parent
b5ce076d8d
commit
90b7ead017
@ -150,7 +150,7 @@ OSAL_TASK_FUNCTION( cdc_serial_app_task ) (void* p_task_para)
|
||||
|
||||
if ( TUSB_ERROR_NONE == error)
|
||||
{
|
||||
for(uint8_t i=0; i<received_bytes; i++) printf("%c", serial_in_buffer[i]);
|
||||
for(uint8_t i=0; i<received_bytes; i++) putchar(serial_in_buffer[i]);
|
||||
|
||||
for(uint8_t dev_addr=1; dev_addr <= TUSB_CFG_HOST_DEVICE_MAX; dev_addr++)
|
||||
{
|
||||
|
@ -163,7 +163,9 @@ static inline void process_kbd_report(hid_keyboard_report_t const *p_new_report)
|
||||
}else
|
||||
{
|
||||
// previously non-existed means key is pressed
|
||||
printf("%c", keycode_to_ascii(p_new_report->modifier, p_new_report->keycode[i]) );
|
||||
uint8_t ch = keycode_to_ascii(p_new_report->modifier, p_new_report->keycode[i]);
|
||||
putchar(ch);
|
||||
if ( ch == '\r' ) putchar('\n'); // added new line for enter key
|
||||
}
|
||||
}
|
||||
// TODO example skips key released
|
||||
|
@ -64,12 +64,12 @@
|
||||
#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 255
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define TUSB_CFG_HOST_HUB 0
|
||||
#define TUSB_CFG_HOST_HID_KEYBOARD 0
|
||||
#define TUSB_CFG_HOST_HUB 1
|
||||
#define TUSB_CFG_HOST_HID_KEYBOARD 1
|
||||
#define TUSB_CFG_HOST_HID_MOUSE 1
|
||||
#define TUSB_CFG_HOST_HID_GENERIC 0
|
||||
#define TUSB_CFG_HOST_MSC 1
|
||||
#define TUSB_CFG_HOST_CDC 0
|
||||
#define TUSB_CFG_HOST_CDC 1
|
||||
#define TUSB_CFG_HOST_CDC_RNDIS 0
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
|
Loading…
x
Reference in New Issue
Block a user