update tinyusb config
This commit is contained in:
parent
58c86bae1d
commit
a360bcc0b4
@ -1 +1 @@
|
||||
Subproject commit a74b2d34e5467d913d86abf3331eab2ccd2def92
|
||||
Subproject commit a24615bffcba2272af9d0d75bdefb6a8a6180e89
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "msc_device_app.h"
|
||||
|
||||
#if CFG_TUSB_DEVICE_MSC
|
||||
#if CFG_TUD_MSC
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -49,7 +49,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_DEVICE_MSC
|
||||
#if CFG_TUD_MSC
|
||||
|
||||
enum
|
||||
{
|
||||
@ -62,7 +62,7 @@ enum
|
||||
If you find any bugs or get any questions, feel free to file an\r\n\
|
||||
issue at github.com/hathach/tinyusb"
|
||||
|
||||
#if CFG_TUSB_MCU==MCU_LPC11UXX || CFG_TUSB_MCU==MCU_LPC13UXX
|
||||
#if CFG_TUSB_MCU==OPT_MCU_LPC11UXX || CFG_TUSB_MCU==OPT_MCU_LPC13UXX
|
||||
#define MSCD_APP_ROMDISK
|
||||
#else // defaults is ram disk
|
||||
#define MSCD_APP_RAMDISK
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "msc_device_app.h"
|
||||
|
||||
#if CFG_TUSB_DEVICE_MSC && defined (MSCD_APP_RAMDISK)
|
||||
#if CFG_TUD_MSC && defined (MSCD_APP_RAMDISK)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACRO CONSTANT TYPEDEF
|
||||
|
@ -46,29 +46,30 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// COMMON CONFIGURATION
|
||||
//--------------------------------------------------------------------+
|
||||
#define CFG_TUSB_CONTROLLER_0_MODE (TUSB_MODE_DEVICE)
|
||||
#define CFG_TUSB_MCU OPT_MCU_NRF5X
|
||||
#define CFG_TUSB_CONTROLLER_0_MODE (OPT_MODE_DEVICE)
|
||||
|
||||
#define CFG_TUSB_DEBUG 2
|
||||
|
||||
#define CFG_TUSB_OS TUSB_OS_NONE
|
||||
#define CFG_TUSB_OS OPT_OS_NONE
|
||||
//#define CFG_TUSB_OS_TASK_PRIO 0
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// DEVICE CONFIGURATION
|
||||
// Note: TUD Stand for Tiny Usb Device
|
||||
//--------------------------------------------------------------------+
|
||||
#define CFG_TUSB_DEVICE_ENDOINT0_SIZE 64
|
||||
#define CFG_TUD_ENDOINT0_SIZE 64
|
||||
|
||||
//------------- CLASS -------------//
|
||||
#define CFG_TUSB_DEVICE_HID_KEYBOARD 0
|
||||
#define CFG_TUSB_DEVICE_HID_MOUSE 0
|
||||
#define CFG_TUSB_DEVICE_HID_GENERIC 0 // not supported yet
|
||||
#define CFG_TUSB_DEVICE_MSC 0
|
||||
#define CFG_TUSB_DEVICE_CDC 1
|
||||
//------------- Class enabled -------------//
|
||||
#define CFG_TUD_HID_KEYBOARD 0
|
||||
#define CFG_TUD_HID_MOUSE 0
|
||||
#define CFG_TUD_HID_GENERIC 0 // not supported yet
|
||||
#define CFG_TUD_MSC 0
|
||||
#define CFG_TUD_CDC 1
|
||||
|
||||
|
||||
/*------------------------------------------------------------------*/
|
||||
/* CLASS
|
||||
* TUD Stand for Tiny Usb Device
|
||||
/* CLASS DRIVER
|
||||
*------------------------------------------------------------------*/
|
||||
|
||||
// FIFO size of CDC TX and RX
|
||||
@ -84,6 +85,14 @@
|
||||
#define CFG_TUSB_ATTR_USBRAM
|
||||
#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
|
||||
|
||||
|
||||
#define BREAKPOINT_IGNORE_COUNT(n) \
|
||||
do {\
|
||||
static uint8_t ignore_count = 0;\
|
||||
ignore_count++;\
|
||||
if ( ignore_count > n ) verify_breakpoint();\
|
||||
}while(0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -53,7 +53,7 @@ tusb_desc_device_t const desc_device =
|
||||
.bDeviceSubClass = MISC_SUBCLASS_COMMON,
|
||||
.bDeviceProtocol = MISC_PROTOCOL_IAD,
|
||||
|
||||
.bMaxPacketSize0 = CFG_TUSB_DEVICE_ENDOINT0_SIZE,
|
||||
.bMaxPacketSize0 = CFG_TUD_ENDOINT0_SIZE,
|
||||
|
||||
.idVendor = CFG_VENDORID,
|
||||
.idProduct = CFG_PRODUCTID,
|
||||
@ -85,7 +85,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
.bMaxPower = TUSB_DESC_CONFIG_POWER_MA(500)
|
||||
},
|
||||
|
||||
#if CFG_TUSB_DEVICE_CDC
|
||||
#if CFG_TUD_CDC
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc =
|
||||
{
|
||||
@ -199,7 +199,7 @@ app_descriptor_configuration_t const desc_configuration =
|
||||
},
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_DEVICE_MSC
|
||||
#if CFG_TUD_MSC
|
||||
.msc =
|
||||
{
|
||||
.interface =
|
||||
|
@ -50,7 +50,7 @@
|
||||
// each combination of interfaces need to have a unique productid, as windows will bind & remember device driver after the first plug.
|
||||
// Auto ProductID layout's Bitmap: (MSB) MassStorage | Generic | Mouse | Key | CDC (LSB)
|
||||
#ifndef CFG_PRODUCTID
|
||||
#define PRODUCTID_BITMAP(interface, n) ( (CFG_TUSB_DEVICE_##interface) << (n) )
|
||||
#define PRODUCTID_BITMAP(interface, n) ( (CFG_TUD_##interface) << (n) )
|
||||
#define CFG_PRODUCTID (0x4000 | ( PRODUCTID_BITMAP(CDC, 0) | PRODUCTID_BITMAP(HID_KEYBOARD, 1) | \
|
||||
PRODUCTID_BITMAP(HID_MOUSE, 2) | PRODUCTID_BITMAP(HID_GENERIC, 3) | \
|
||||
PRODUCTID_BITMAP(MSC, 4) ) )
|
||||
@ -60,7 +60,7 @@
|
||||
#define ITF_NUM_MSC 2
|
||||
|
||||
// total number of interfaces
|
||||
#define ITF_TOTAL (CFG_TUSB_DEVICE_CDC*2 + CFG_TUSB_DEVICE_MSC)
|
||||
#define ITF_TOTAL (CFG_TUD_CDC*2 + CFG_TUD_MSC)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// Endpoints Address & Max Packet Size
|
||||
@ -87,7 +87,7 @@ typedef struct ATTR_PACKED
|
||||
{
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
#if CFG_TUSB_DEVICE_CDC
|
||||
#if CFG_TUD_CDC
|
||||
struct ATTR_PACKED
|
||||
{
|
||||
tusb_desc_interface_assoc_t iad;
|
||||
@ -107,7 +107,7 @@ typedef struct ATTR_PACKED
|
||||
}cdc;
|
||||
#endif
|
||||
|
||||
#if CFG_TUSB_DEVICE_MSC
|
||||
#if CFG_TUD_MSC
|
||||
struct ATTR_PACKED
|
||||
{
|
||||
tusb_desc_interface_t interface;
|
||||
|
Loading…
Reference in New Issue
Block a user