refactor hid, rename hid_generic to simply hid_

This commit is contained in:
hathach
2019-04-18 00:36:17 +07:00
parent 395fd54dcb
commit cc2fce31e5
7 changed files with 66 additions and 170 deletions

View File

@@ -144,18 +144,14 @@ void usb_hid_task(void)
tud_remote_wakeup();
}
#if 0
#if 1
/*------------- Keyboard -------------*/
if ( tud_hid_keyboard_ready() )
if ( tud_hid_ready() )
{
if ( btn )
{
uint8_t keycode[6] = { 0 };
for(uint8_t i=0; i < 6; i++)
{
if ( btn & (1 << i) ) keycode[i] = HID_KEY_A + i;
}
keycode[0] = HID_KEY_A;
tud_hid_keyboard_keycode(0, keycode);
}else
@@ -180,7 +176,7 @@ void usb_hid_task(void)
#endif
}
uint16_t tud_hid_generic_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
{
// TODO not Implemented
(void) report_id;
@@ -191,7 +187,7 @@ uint16_t tud_hid_generic_get_report_cb(uint8_t report_id, hid_report_type_t repo
return 0;
}
void tud_hid_generic_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
{
// TODO not Implemented
(void) report_id;

View File

@@ -120,10 +120,5 @@ tud_desc_set_t tud_desc_set =
.string_arr = (uint8_t const **) string_desc_arr,
.string_count = sizeof(string_desc_arr)/sizeof(string_desc_arr[0]),
.hid_report =
{
.generic = NULL,
.boot_keyboard = NULL,
.boot_mouse = NULL
}
.hid_report = NULL,
};

View File

@@ -193,13 +193,13 @@ void usb_hid_task(void* params)
}
}
uint16_t tud_hid_generic_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
uint16_t tud_hid_get_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t* buffer, uint16_t reqlen)
{
// TODO not Implemented
return 0;
}
void tud_hid_generic_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
void tud_hid_set_report_cb(uint8_t report_id, hid_report_type_t report_type, uint8_t const* buffer, uint16_t bufsize)
{
// TODO not Implemented
}