mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-07 10:21:30 +00:00
remove static port defined for device/host
This commit is contained in:
parent
8b9cf152a0
commit
2571211957
@ -54,7 +54,9 @@ void cdc_task(void);
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
board_init();
|
board_init();
|
||||||
tusb_init();
|
|
||||||
|
// init device stack on configured roothub port
|
||||||
|
tud_init(BOARD_TUD_RHPORT);
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
@ -96,8 +96,8 @@ void board_init(void)
|
|||||||
SysTick_Config(SystemCoreClock / 1000);
|
SysTick_Config(SystemCoreClock / 1000);
|
||||||
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
|
#elif CFG_TUSB_OS == OPT_OS_FREERTOS
|
||||||
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
|
// If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
|
||||||
NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
|
NVIC_SetPriority(USB0_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
|
||||||
NVIC_SetPriority(USB1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
|
NVIC_SetPriority(USB1_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Chip_GPIO_Init(LPC_GPIO_PORT);
|
Chip_GPIO_Init(LPC_GPIO_PORT);
|
||||||
|
10
src/tusb.c
10
src/tusb.c
@ -38,12 +38,14 @@
|
|||||||
|
|
||||||
bool tusb_init(void)
|
bool tusb_init(void)
|
||||||
{
|
{
|
||||||
#if CFG_TUD_ENABLED
|
#if CFG_TUD_ENABLED && defined(TUD_OPT_RHPORT)
|
||||||
TU_ASSERT ( tud_init(TUD_OPT_RHPORT) ); // init device stack
|
// init device stack CFG_TUSB_RHPORTx_MODE must be defined
|
||||||
|
TU_ASSERT ( tud_init(TUD_OPT_RHPORT) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CFG_TUH_ENABLED
|
#if CFG_TUH_ENABLED && defined(TUH_OPT_RHPORT)
|
||||||
TU_ASSERT( tuh_init(TUH_OPT_RHPORT) ); // init host stack
|
// init host stack CFG_TUSB_RHPORTx_MODE must be defined
|
||||||
|
TU_ASSERT( tuh_init(TUH_OPT_RHPORT) );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -197,15 +197,6 @@ typedef int make_iso_compilers_happy ;
|
|||||||
|
|
||||||
//------------- Roothub as Device -------------//
|
//------------- Roothub as Device -------------//
|
||||||
|
|
||||||
//#ifndef CFG_TUSB_RHPORT0_MODE
|
|
||||||
// #define CFG_TUSB_RHPORT0_MODE OPT_MODE_NONE
|
|
||||||
//#endif
|
|
||||||
//
|
|
||||||
//#ifndef CFG_TUSB_RHPORT1_MODE
|
|
||||||
// #define CFG_TUSB_RHPORT1_MODE OPT_MODE_NONE
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(CFG_TUSB_RHPORT0_MODE) && ((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_DEVICE)
|
#if defined(CFG_TUSB_RHPORT0_MODE) && ((CFG_TUSB_RHPORT0_MODE) & OPT_MODE_DEVICE)
|
||||||
#define TUD_RHPORT_MODE (CFG_TUSB_RHPORT0_MODE)
|
#define TUD_RHPORT_MODE (CFG_TUSB_RHPORT0_MODE)
|
||||||
#define TUD_OPT_RHPORT 0
|
#define TUD_OPT_RHPORT 0
|
||||||
@ -214,7 +205,6 @@ typedef int make_iso_compilers_happy ;
|
|||||||
#define TUD_OPT_RHPORT 1
|
#define TUD_OPT_RHPORT 1
|
||||||
#else
|
#else
|
||||||
#define TUD_RHPORT_MODE OPT_MODE_NONE
|
#define TUD_RHPORT_MODE OPT_MODE_NONE
|
||||||
#define TUD_OPT_RHPORT -1
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CFG_TUD_ENABLED
|
#ifndef CFG_TUD_ENABLED
|
||||||
@ -228,7 +218,7 @@ typedef int make_iso_compilers_happy ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// highspeed support indicator
|
// highspeed support indicator
|
||||||
#define TUD_OPT_HIGH_SPEED (CFG_TUD_MAX_SPEED ? CFG_TUD_MAX_SPEED : TUP_RHPORT_HIGHSPEED)
|
#define TUD_OPT_HIGH_SPEED (CFG_TUD_MAX_SPEED ? CFG_TUD_MAX_SPEED : TUP_RHPORT_HIGHSPEED)
|
||||||
|
|
||||||
//------------- Roothub as Host -------------//
|
//------------- Roothub as Host -------------//
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user