fix descriptors for device
This commit is contained in:
@@ -13,7 +13,7 @@ buildname := $(shell echo $(notdir $(build_dir)) | tr a-z A-Z)
|
|||||||
board = $(buildname)
|
board = $(buildname)
|
||||||
mcu = $(shell echo $(MCU) | tr A-Z a-z)
|
mcu = $(shell echo $(MCU) | tr A-Z a-z)
|
||||||
|
|
||||||
$(info board $(board) )
|
$(warning board $(board) )
|
||||||
|
|
||||||
ifeq (,$(findstring BOARD_,$(board)))
|
ifeq (,$(findstring BOARD_,$(board)))
|
||||||
$(error build's name must be name exactly the same as the macro BOARD_NAME defined in the tinyusb/demos/boards/board.h)
|
$(error build's name must be name exactly the same as the macro BOARD_NAME defined in the tinyusb/demos/boards/board.h)
|
||||||
@@ -25,7 +25,7 @@ ifeq (,$(MCU))
|
|||||||
$(error build name must contain one of supported mcu: $(mcu_support))
|
$(error build name must contain one of supported mcu: $(mcu_support))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(info MCU $(MCU) $(mcu))
|
$(warning MCU $(MCU) $(mcu))
|
||||||
|
|
||||||
################ Build Manipulate ################
|
################ Build Manipulate ################
|
||||||
#Remove all other mcu in demos/bsp and keep only needed one
|
#Remove all other mcu in demos/bsp and keep only needed one
|
||||||
|
@@ -367,8 +367,8 @@ ATTR_ALIGNED(4) const USB_STR_DESCRIPTOR USB_StringDescriptor =
|
|||||||
.strManufacturer = {'t', 'i', 'n', 'y', 'U', 'S', 'B'},
|
.strManufacturer = {'t', 'i', 'n', 'y', 'U', 'S', 'B'},
|
||||||
|
|
||||||
.Product = { .bLength = USB_STRING_LEN(sizeof(CFG_USB_STRING_PRODUCT)-1), .bDescriptorType = USB_STRING_DESCRIPTOR_TYPE },
|
.Product = { .bLength = USB_STRING_LEN(sizeof(CFG_USB_STRING_PRODUCT)-1), .bDescriptorType = USB_STRING_DESCRIPTOR_TYPE },
|
||||||
.strProduct = {'D', 'e', 'v', 'i', 'c', ' ', 'e', 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd'},
|
.strProduct = {'D', 'e', 'v', 'i', 'c', 'e', ' ', 'K', 'e', 'y', 'b', 'o', 'a', 'r', 'd'},
|
||||||
|
|
||||||
.Serial = { .bLength = USB_STRING_LEN(USB_STRING_SERIAL_LEN), .bDescriptorType = USB_STRING_DESCRIPTOR_TYPE },
|
.Serial = { .bLength = USB_STRING_LEN(sizeof(CFG_USB_STRING_SERIAL)-1), .bDescriptorType = USB_STRING_DESCRIPTOR_TYPE },
|
||||||
.strSerial = {'1', '2', '3', '4'}
|
.strSerial = {'1', '2', '3', '4'}
|
||||||
};
|
};
|
||||||
|
@@ -44,38 +44,38 @@ int main(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// #ifdef CFG_CLASS_CDC
|
#ifdef CFG_CLASS_CDC
|
||||||
// if (usb_isConfigured())
|
if (usb_isConfigured())
|
||||||
// {
|
{
|
||||||
// uint8_t cdc_char;
|
uint8_t cdc_char;
|
||||||
// if( tusb_cdc_getc(&cdc_char) )
|
if( tusb_cdc_getc(&cdc_char) )
|
||||||
// {
|
{
|
||||||
// switch (cdc_char)
|
switch (cdc_char)
|
||||||
// {
|
{
|
||||||
// #ifdef CFG_CLASS_HID_KEYBOARD
|
#ifdef CFG_CLASS_HID_KEYBOARD
|
||||||
// case '1' :
|
case '1' :
|
||||||
// {
|
{
|
||||||
// uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA + 'e' - 'a'};
|
uint8_t keys[6] = {HID_USAGE_KEYBOARD_aA + 'e' - 'a'};
|
||||||
// tusb_hid_keyboard_sendKeys(0x08, keys, 1); // windows + E --> open explorer
|
tusb_hid_keyboard_sendKeys(0x08, keys, 1); // windows + E --> open explorer
|
||||||
// }
|
}
|
||||||
// break;
|
break;
|
||||||
// #endif
|
#endif
|
||||||
//
|
|
||||||
// #ifdef CFG_CLASS_HID_MOUSE
|
#ifdef CFG_CLASS_HID_MOUSE
|
||||||
// case '2' :
|
case '2' :
|
||||||
// tusb_hid_mouse_send(0, 10, 10);
|
tusb_hid_mouse_send(0, 10, 10);
|
||||||
// break;
|
break;
|
||||||
// #endif
|
#endif
|
||||||
//
|
|
||||||
// default :
|
default :
|
||||||
// cdc_char = toupper(cdc_char);
|
cdc_char = toupper(cdc_char);
|
||||||
// tusb_cdc_putc(cdc_char);
|
tusb_cdc_putc(cdc_char);
|
||||||
// break;
|
break;
|
||||||
//
|
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -5,6 +5,6 @@ proj_path = $(build_dir)/..
|
|||||||
#get workspace absolute path
|
#get workspace absolute path
|
||||||
workspace_dir = $(shell cd $(proj_path)/../../.. ; pwd)
|
workspace_dir = $(shell cd $(proj_path)/../../.. ; pwd)
|
||||||
#workspace_dir = $(proj_path)/../../../
|
#workspace_dir = $(proj_path)/../../../
|
||||||
$(info workspace $(workspace_dir))
|
$(warning workspace $(workspace_dir))
|
||||||
|
|
||||||
include $(workspace_dir)/demos/demos.mk
|
include $(workspace_dir)/demos/demos.mk
|
||||||
|
Reference in New Issue
Block a user