more example update
This commit is contained in:
		@@ -30,37 +30,42 @@
 | 
			
		||||
 extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
// COMMON CONFIGURATION
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// Board Specific Configuration
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
 | 
			
		||||
// RHPort number used for device can be defined by board.mk, default to port 0
 | 
			
		||||
#ifndef BOARD_TUD_RHPORT
 | 
			
		||||
  #define BOARD_TUD_RHPORT     0
 | 
			
		||||
#define BOARD_TUD_RHPORT      0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// RHPort max operational speed can defined by board.mk
 | 
			
		||||
// Default to max (auto) speed for MCU with internal HighSpeed PHY
 | 
			
		||||
#ifndef BOARD_TUD_MAX_SPEED
 | 
			
		||||
  #define BOARD_TUD_MAX_SPEED   OPT_MODE_DEFAULT_SPEED
 | 
			
		||||
#define BOARD_TUD_MAX_SPEED   OPT_MODE_DEFAULT_SPEED
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Device mode with rhport and speed defined by board.mk
 | 
			
		||||
#if   BOARD_TUD_RHPORT == 0
 | 
			
		||||
  #define CFG_TUSB_RHPORT0_MODE     (OPT_MODE_DEVICE | BOARD_TUD_MAX_SPEED)
 | 
			
		||||
#elif BOARD_TUD_RHPORT == 1
 | 
			
		||||
  #define CFG_TUSB_RHPORT1_MODE     (OPT_MODE_DEVICE | BOARD_TUD_MAX_SPEED)
 | 
			
		||||
#else
 | 
			
		||||
  #error "Incorrect RHPort configuration"
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
// Common Configuration
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
// defined by compiler flags for flexibility
 | 
			
		||||
#ifndef CFG_TUSB_MCU
 | 
			
		||||
#error CFG_TUSB_MCU must be defined
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// This example doesn't use an RTOS
 | 
			
		||||
#ifndef CFG_TUSB_OS
 | 
			
		||||
#define CFG_TUSB_OS               OPT_OS_NONE
 | 
			
		||||
#define CFG_TUSB_OS           OPT_OS_NONE
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
 | 
			
		||||
// #define CFG_TUSB_DEBUG           0
 | 
			
		||||
#ifndef CFG_TUSB_DEBUG
 | 
			
		||||
#define CFG_TUSB_DEBUG        0
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
// Enable Device stack
 | 
			
		||||
#define CFG_TUD_ENABLED       1
 | 
			
		||||
 | 
			
		||||
// Default is max speed that hardware controller could support with on-chip PHY
 | 
			
		||||
#define CFG_TUD_MAX_SPEED     BOARD_TUD_MAX_SPEED
 | 
			
		||||
 | 
			
		||||
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
 | 
			
		||||
 * Tinyusb use follows macros to declare transferring memory so that they can be put
 | 
			
		||||
@@ -74,7 +79,7 @@
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#ifndef CFG_TUSB_MEM_ALIGN
 | 
			
		||||
#define CFG_TUSB_MEM_ALIGN          __attribute__ ((aligned(4)))
 | 
			
		||||
#define CFG_TUSB_MEM_ALIGN        __attribute__ ((aligned(4)))
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user