fix descriptors for device

This commit is contained in:
hathach
2012-12-07 10:53:52 +07:00
parent daa1e125a1
commit cc45f35d70
4 changed files with 37 additions and 37 deletions

View File

@@ -44,38 +44,38 @@ int main(void)
#endif
}
// #ifdef CFG_CLASS_CDC
// if (usb_isConfigured())
// {
// uint8_t cdc_char;
// if( tusb_cdc_getc(&cdc_char) )
// {
// switch (cdc_char)
// {
// #ifdef CFG_CLASS_HID_KEYBOARD
// case '1' :
// {
// uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA + 'e' - 'a'};
// tusb_hid_keyboard_sendKeys(0x08, keys, 1); // windows + E --> open explorer
// }
// break;
// #endif
//
// #ifdef CFG_CLASS_HID_MOUSE
// case '2' :
// tusb_hid_mouse_send(0, 10, 10);
// break;
// #endif
//
// default :
// cdc_char = toupper(cdc_char);
// tusb_cdc_putc(cdc_char);
// break;
//
// }
// }
// }
//#endif
#ifdef CFG_CLASS_CDC
if (usb_isConfigured())
{
uint8_t cdc_char;
if( tusb_cdc_getc(&cdc_char) )
{
switch (cdc_char)
{
#ifdef CFG_CLASS_HID_KEYBOARD
case '1' :
{
uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA + 'e' - 'a'};
tusb_hid_keyboard_sendKeys(0x08, keys, 1); // windows + E --> open explorer
}
break;
#endif
#ifdef CFG_CLASS_HID_MOUSE
case '2' :
tusb_hid_mouse_send(0, 10, 10);
break;
#endif
default :
cdc_char = toupper(cdc_char);
tusb_cdc_putc(cdc_char);
break;
}
}
}
#endif
}
return 0;