upgrade tusb

This commit is contained in:
hathach 2018-07-02 11:09:00 +07:00
parent 3ab0e8f102
commit 5f1bf84941
5 changed files with 18 additions and 15 deletions

@ -1 +1 @@
Subproject commit cfd5e1e6d19d94481ef84b4a16b41b2fae6c252e Subproject commit 142300ca60d4c08d3d05df77c943e76b4336b21f

View File

@ -60,7 +60,6 @@
#include "nrf_usbd.h" #include "nrf_usbd.h"
#include "tusb.h" #include "tusb.h"
#include "usb/tusb_descriptors.h"
#include "usb/msc_uf2.h" #include "usb/msc_uf2.h"
@ -357,9 +356,6 @@ int main(void)
// Init usb stack // Init usb stack
tusb_init(); tusb_init();
// Set usb descriptors
tud_set_descriptors(&usb_desc_init);
/*------------- Determine DFU mode (Serial, OTA, FRESET or normal) -------------*/ /*------------- Determine DFU mode (Serial, OTA, FRESET or normal) -------------*/
/* For metro52 LED_BLUE is muxed with FRESET. We only init FRESET BUTTON /* For metro52 LED_BLUE is muxed with FRESET. We only init FRESET BUTTON

View File

@ -49,15 +49,22 @@
#define CFG_TUSB_MCU OPT_MCU_NRF5X #define CFG_TUSB_MCU OPT_MCU_NRF5X
#define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE #define CFG_TUSB_RHPORT0_MODE OPT_MODE_DEVICE
#define CFG_TUSB_OS OPT_OS_NONE
//#define CFG_TUD_TASK_PRIO 0
#define CFG_TUSB_DEBUG 0 #define CFG_TUSB_DEBUG 0
/*------------- RTOS -------------*/
#define CFG_TUSB_OS OPT_OS_NONE
//#define CFG_TUD_TASK_PRIO 0
//#define CFG_TUD_TASK_QUEUE_SZ 16
//#define CFG_TUD_TASK_STACK_SZ 150
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// DEVICE CONFIGURATION // DEVICE CONFIGURATION
// Note: TUD Stand for Tiny Usb Device // Note: TUD Stand for Tiny Usb Device
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
/*------------- Core -------------*/
#define CFG_TUD_DESC_AUTO 0
#define CFG_TUD_ENDOINT0_SIZE 64 #define CFG_TUD_ENDOINT0_SIZE 64
//------------- Class enabled -------------// //------------- Class enabled -------------//

View File

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

View File

@ -125,6 +125,6 @@ typedef struct ATTR_PACKED
} app_descriptor_configuration_t; } app_descriptor_configuration_t;
extern tud_desc_init_t usb_desc_init; extern tud_desc_set_t tud_desc_set;
#endif #endif