add CFG_TUD_DESC_AUTO for auto descritpor (device, config)

This commit is contained in:
hathach
2018-07-01 15:11:58 +07:00
parent cfd5e1e6d1
commit ff219f1f01
9 changed files with 64 additions and 270 deletions

View File

@@ -202,7 +202,7 @@ app_descriptor_configuration_t const desc_configuration =
#define ENDIAN_BE16_FROM( high, low) ENDIAN_BE16(high << 8 | low)
// array of pointer to string descriptors
uint16_t const * const string_descriptor_arr [] =
uint16_t const * const string_desc_arr [] =
{
[0] = (uint16_t []) { // supported language
ENDIAN_BE16_FROM( STRING_LEN_UNICODE(1), TUSB_DESC_STRING ),
@@ -247,9 +247,9 @@ uint16_t const * const string_descriptor_arr [] =
/*------------- Variable used by tud_set_descriptors -------------*/
tud_desc_init_t usb_desc_init =
tud_desc_set_t usb_desc_init =
{
.device = (uint8_t const * ) &desc_device,
.configuration = (uint8_t const * ) &desc_configuration,
.string_arr = (uint8_t const **) string_descriptor_arr,
.string_arr = (uint8_t const **) string_desc_arr,
};

View File

@@ -100,6 +100,6 @@ typedef struct ATTR_PACKED
extern tud_desc_init_t usb_desc_init;
extern tud_desc_set_t usb_desc_init;
#endif