mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-16 14:42:58 +00:00
change usage of TU_CHECK_MCU() to prevent macro conflict
This commit is contained in:
parent
85e18b9172
commit
dbd31895bc
@ -81,12 +81,12 @@ enum
|
|||||||
|
|
||||||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_FOUR_CH_DESC_LEN)
|
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + CFG_TUD_AUDIO * TUD_AUDIO_MIC_FOUR_CH_DESC_LEN)
|
||||||
|
|
||||||
#if TU_CHECK_MCU(LPC175X_6X) || TU_CHECK_MCU(LPC177X_8X) || TU_CHECK_MCU(LPC40XX)
|
#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
||||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||||
#define EPNUM_AUDIO 0x03
|
#define EPNUM_AUDIO 0x03
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(NRF5X)
|
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||||
// nRF5x ISO can only be endpoint 8
|
// nRF5x ISO can only be endpoint 8
|
||||||
#define EPNUM_AUDIO 0x08
|
#define EPNUM_AUDIO 0x08
|
||||||
|
|
||||||
@ -96,11 +96,11 @@ enum
|
|||||||
|
|
||||||
uint8_t const desc_configuration[] =
|
uint8_t const desc_configuration[] =
|
||||||
{
|
{
|
||||||
// Interface count, string index, total length, attribute, power in mA
|
// Interface count, string index, total length, attribute, power in mA
|
||||||
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),
|
||||||
|
|
||||||
// Interface number, string index, EP Out & EP In address, EP size
|
// Interface number, string index, EP Out & EP In address, EP size
|
||||||
TUD_AUDIO_MIC_FOUR_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
|
TUD_AUDIO_MIC_FOUR_CH_DESCRIPTOR(/*_itfnum*/ ITF_NUM_AUDIO_CONTROL, /*_stridx*/ 0, /*_nBytesPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX, /*_nBitsUsedPerSample*/ CFG_TUD_AUDIO_FUNC_1_N_BYTES_PER_SAMPLE_TX*8, /*_epin*/ 0x80 | EPNUM_AUDIO, /*_epsize*/ CFG_TUD_AUDIO_EP_SZ_IN)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Invoked when received GET CONFIGURATION DESCRIPTOR
|
// Invoked when received GET CONFIGURATION DESCRIPTOR
|
||||||
|
@ -86,7 +86,7 @@ enum
|
|||||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In etc ...
|
||||||
#define EPNUM_AUDIO 0x03
|
#define EPNUM_AUDIO 0x03
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(NRF5X)
|
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||||
// nRF5x ISO can only be endpoint 8
|
// nRF5x ISO can only be endpoint 8
|
||||||
#define EPNUM_AUDIO 0x08
|
#define EPNUM_AUDIO 0x08
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "bsp/board.h"
|
#include "bsp/board.h"
|
||||||
#include "tusb.h"
|
#include "tusb.h"
|
||||||
|
|
||||||
#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
// ESP-IDF need "freertos/" prefix in include path.
|
// ESP-IDF need "freertos/" prefix in include path.
|
||||||
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
|
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
@ -105,14 +105,14 @@ int main(void)
|
|||||||
(void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
|
(void) xTaskCreateStatic( cdc_task, "cdc", CDC_STACK_SZIE, NULL, configMAX_PRIORITIES-2, cdc_stack, &cdc_taskdef);
|
||||||
|
|
||||||
// skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
|
// skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
|
||||||
#if !( TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) )
|
#if !TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
void app_main(void)
|
void app_main(void)
|
||||||
{
|
{
|
||||||
main();
|
main();
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
||||||
|
|
||||||
// Espressif IDF requires "freertos/" prefix in include path
|
// Espressif IDF requires "freertos/" prefix in include path
|
||||||
#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
#define CFG_TUSB_OS_INC_PATH freertos/
|
#define CFG_TUSB_OS_INC_PATH freertos/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "tusb.h"
|
#include "tusb.h"
|
||||||
#include "usb_descriptors.h"
|
#include "usb_descriptors.h"
|
||||||
|
|
||||||
#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
// ESP-IDF need "freertos/" prefix in include path.
|
// ESP-IDF need "freertos/" prefix in include path.
|
||||||
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
|
// CFG_TUSB_OS_INC_PATH should be defined accordingly.
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
@ -105,14 +105,14 @@ int main(void)
|
|||||||
(void) xTaskCreateStatic( hid_task, "hid", HID_STACK_SZIE, NULL, configMAX_PRIORITIES-2, hid_stack, &hid_taskdef);
|
(void) xTaskCreateStatic( hid_task, "hid", HID_STACK_SZIE, NULL, configMAX_PRIORITIES-2, hid_stack, &hid_taskdef);
|
||||||
|
|
||||||
// skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
|
// skip starting scheduler (and return) for ESP32-S2 or ESP32-S3
|
||||||
#if !( TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3) )
|
#if !TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
vTaskStartScheduler();
|
vTaskStartScheduler();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
void app_main(void)
|
void app_main(void)
|
||||||
{
|
{
|
||||||
main();
|
main();
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
#define CFG_TUSB_OS OPT_OS_FREERTOS
|
||||||
|
|
||||||
// Espressif IDF requires "freertos/" prefix in include path
|
// Espressif IDF requires "freertos/" prefix in include path
|
||||||
#if TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
|
#if TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
#define CFG_TUSB_OS_INC_PATH freertos/
|
#define CFG_TUSB_OS_INC_PATH freertos/
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -77,12 +77,12 @@ uint8_t const * tud_descriptor_device_cb(void)
|
|||||||
|
|
||||||
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_LEN)
|
#define CONFIG_TOTAL_LEN (TUD_CONFIG_DESC_LEN + TUD_VIDEO_CAPTURE_DESC_LEN)
|
||||||
|
|
||||||
#if TU_CHECK_MCU(LPC175X_6X) || TU_CHECK_MCU(LPC177X_8X) || TU_CHECK_MCU(LPC40XX)
|
#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
||||||
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
// LPC 17xx and 40xx endpoint type (bulk/interrupt/iso) are fixed by its number
|
||||||
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
|
// 0 control, 1 In, 2 Bulk, 3 Iso, 4 In, 5 Bulk etc ...
|
||||||
#define EPNUM_VIDEO_IN 0x83
|
#define EPNUM_VIDEO_IN 0x83
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(NRF5X)
|
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||||
// nRF5x ISO can only be endpoint 8
|
// nRF5x ISO can only be endpoint 8
|
||||||
#define EPNUM_VIDEO_IN 0x88
|
#define EPNUM_VIDEO_IN 0x88
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ bool mscd_xfer_cb(uint8_t rhport, uint8_t ep_addr, xfer_result_t event, uint32_t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if TU_CHECK_MCU(CXD56)
|
#if TU_CHECK_MCU(OPT_MCU_CXD56)
|
||||||
// WORKAROUND: cxd56 has its own nuttx usb stack which does not forward Set/ClearFeature(Endpoint) to DCD.
|
// WORKAROUND: cxd56 has its own nuttx usb stack which does not forward Set/ClearFeature(Endpoint) to DCD.
|
||||||
// There is no way for us to know when EP is un-stall, therefore we will unconditionally un-stall here and
|
// There is no way for us to know when EP is un-stall, therefore we will unconditionally un-stall here and
|
||||||
// hope everything will work
|
// hope everything will work
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/* Count number of arguments of __VA_ARGS__
|
/* Count number of arguments of __VA_ARGS__
|
||||||
* - reference https://groups.google.com/forum/#!topic/comp.std.c/d-6Mj5Lko_s
|
* - reference https://stackoverflow.com/questions/2124339/c-preprocessor-va-args-number-of-arguments
|
||||||
* - _GET_NTH_ARG() takes args >= N (64) but only expand to Nth one (64th)
|
* - _GET_NTH_ARG() takes args >= N (64) but only expand to Nth one (64th)
|
||||||
* - _RSEQ_N() is reverse sequential to N to add padding to have
|
* - _RSEQ_N() is reverse sequential to N to add padding to have
|
||||||
* Nth position is the same as the number of arguments
|
* Nth position is the same as the number of arguments
|
||||||
|
@ -36,59 +36,59 @@
|
|||||||
// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
|
// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
|
||||||
|
|
||||||
//------------- NXP -------------//
|
//------------- NXP -------------//
|
||||||
#if TU_CHECK_MCU(LPC11UXX, LPC13XX, LPC15XX)
|
#if TU_CHECK_MCU(OPT_MCU_LPC11UXX, OPT_MCU_LPC13XX, OPT_MCU_LPC15XX)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 5
|
#define DCD_ATTR_ENDPOINT_MAX 5
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC175X_6X, LPC177X_8X, LPC40XX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 16
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC18XX, LPC43XX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
|
||||||
// TODO USB0 has 6, USB1 has 4
|
// TODO USB0 has 6, USB1 has 4
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC51UXX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC51UXX)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 5
|
#define DCD_ATTR_ENDPOINT_MAX 5
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC54XXX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC54XXX)
|
||||||
// TODO USB0 has 5, USB1 has 6
|
// TODO USB0 has 5, USB1 has 6
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC55XX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC55XX)
|
||||||
// TODO USB0 has 5, USB1 has 6
|
// TODO USB0 has 5, USB1 has 6
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(MIMXRT10XX)
|
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(MKL25ZXX, K32L2BXX)
|
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 16
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(MM32F327X)
|
#elif TU_CHECK_MCU(OPT_MCU_MM32F327X)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 16
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
||||||
|
|
||||||
//------------- Nordic -------------//
|
//------------- Nordic -------------//
|
||||||
#elif TU_CHECK_MCU(NRF5X)
|
#elif TU_CHECK_MCU(OPT_MCU_NRF5X)
|
||||||
// 8 CBI + 1 ISO
|
// 8 CBI + 1 ISO
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 9
|
#define DCD_ATTR_ENDPOINT_MAX 9
|
||||||
|
|
||||||
//------------- Microchip -------------//
|
//------------- Microchip -------------//
|
||||||
#elif TU_CHECK_MCU(SAMD21, SAMD51, SAME5X) || \
|
#elif TU_CHECK_MCU(OPT_MCU_SAMD21, OPT_MCU_SAMD51, OPT_MCU_SAME5X) || \
|
||||||
TU_CHECK_MCU(SAMD11, SAML21, SAML22)
|
TU_CHECK_MCU(OPT_MCU_SAMD11, OPT_MCU_SAML21, OPT_MCU_SAML22)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(SAMG)
|
#elif TU_CHECK_MCU(OPT_MCU_SAMG)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(SAMX7X)
|
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 10
|
#define DCD_ATTR_ENDPOINT_MAX 10
|
||||||
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
||||||
|
|
||||||
//------------- ST -------------//
|
//------------- ST -------------//
|
||||||
#elif TU_CHECK_MCU(STM32F0)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F0)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F1)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F1)
|
||||||
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
|
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
|
||||||
defined (STM32F107xB) || defined (STM32F107xC)
|
defined (STM32F107xB) || defined (STM32F107xC)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 4
|
#define DCD_ATTR_ENDPOINT_MAX 4
|
||||||
@ -97,32 +97,32 @@
|
|||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F2)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F2)
|
||||||
// FS has 4 ep, HS has 5 ep
|
// FS has 4 ep, HS has 5 ep
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
#define DCD_ATTR_DWC2_STM32
|
#define DCD_ATTR_DWC2_STM32
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F3)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F3)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F4)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F4)
|
||||||
// For most mcu, FS has 4, HS has 6. TODO 446/469/479 HS has 9
|
// For most mcu, FS has 4, HS has 6. TODO 446/469/479 HS has 9
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
#define DCD_ATTR_DWC2_STM32
|
#define DCD_ATTR_DWC2_STM32
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F7)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F7)
|
||||||
// FS has 6, HS has 9
|
// FS has 6, HS has 9
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 9
|
#define DCD_ATTR_ENDPOINT_MAX 9
|
||||||
#define DCD_ATTR_DWC2_STM32
|
#define DCD_ATTR_DWC2_STM32
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32H7)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32H7)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 9
|
#define DCD_ATTR_ENDPOINT_MAX 9
|
||||||
#define DCD_ATTR_DWC2_STM32
|
#define DCD_ATTR_DWC2_STM32
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32L0, STM32L1)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32L4)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32L4)
|
||||||
#if defined (STM32L475xx) || defined (STM32L476xx) || \
|
#if defined (STM32L475xx) || defined (STM32L476xx) || \
|
||||||
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
|
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
|
||||||
defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
|
defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
|
||||||
@ -134,53 +134,50 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//------------- Sony -------------//
|
//------------- Sony -------------//
|
||||||
#elif TU_CHECK_MCU(CXD56)
|
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 7
|
#define DCD_ATTR_ENDPOINT_MAX 7
|
||||||
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
#define DCD_ATTR_ENDPOINT_EXCLUSIVE_NUMBER
|
||||||
|
|
||||||
//------------- TI -------------//
|
//------------- TI -------------//
|
||||||
#elif TU_CHECK_MCU(MSP430x5xx)
|
#elif TU_CHECK_MCU(OPT_MCU_MSP430x5xx)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
//------------- ValentyUSB -------------//
|
//------------- ValentyUSB -------------//
|
||||||
#elif TU_CHECK_MCU(VALENTYUSB_EPTRI)
|
#elif TU_CHECK_MCU(OPT_MCU_VALENTYUSB_EPTRI)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 16
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
||||||
|
|
||||||
//------------- Nuvoton -------------//
|
//------------- Nuvoton -------------//
|
||||||
#elif TU_CHECK_MCU(NUC121) || TU_CHECK_MCU(NUC126)
|
#elif TU_CHECK_MCU(OPT_MCU_NUC121, OPT_MCU_NUC126)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 8
|
#define DCD_ATTR_ENDPOINT_MAX 8
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(NUC120)
|
#elif TU_CHECK_MCU(OPT_MCU_NUC120)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(NUC505)
|
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 12
|
#define DCD_ATTR_ENDPOINT_MAX 12
|
||||||
|
|
||||||
//------------- Espressif -------------//
|
//------------- Espressif -------------//
|
||||||
#elif TU_CHECK_MCU(ESP32S2, ESP32S3)
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 6
|
#define DCD_ATTR_ENDPOINT_MAX 6
|
||||||
|
|
||||||
//------------- Dialog -------------//
|
//------------- Dialog -------------//
|
||||||
#elif TU_CHECK_MCU(DA1469X)
|
#elif TU_CHECK_MCU(OPT_MCU_DA1469X)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 4
|
#define DCD_ATTR_ENDPOINT_MAX 4
|
||||||
|
|
||||||
//------------- Raspberry Pi -------------//
|
//------------- Raspberry Pi -------------//
|
||||||
#elif TU_CHECK_MCU(RP2040)
|
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 16
|
#define DCD_ATTR_ENDPOINT_MAX 16
|
||||||
|
|
||||||
//------------- Silabs -------------//
|
//------------- Silabs -------------//
|
||||||
#elif TU_CHECK_MCU(EFM32GG) || TU_CHECK_MCU(EFM32GG11) || TU_CHECK_MCU(EFM32GG12)
|
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_EFM32GG11, OPT_MCU_EFM32GG12)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 7
|
#define DCD_ATTR_ENDPOINT_MAX 7
|
||||||
|
|
||||||
//------------- Renesas -------------//
|
//------------- Renesas -------------//
|
||||||
#elif TU_CHECK_MCU(RX63X) || TU_CHECK_MCU(RX65X) || TU_CHECK_MCU(RX72N)
|
#elif TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 10
|
#define DCD_ATTR_ENDPOINT_MAX 10
|
||||||
|
|
||||||
//#elif TU_CHECK_MCU(MM32F327X)
|
|
||||||
// #define DCD_ATTR_ENDPOINT_MAX not known yet
|
|
||||||
|
|
||||||
//------------- GigaDevice -------------//
|
//------------- GigaDevice -------------//
|
||||||
#elif TU_CHECK_MCU(GD32VF103)
|
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
|
||||||
#define DCD_ATTR_ENDPOINT_MAX 4
|
#define DCD_ATTR_ENDPOINT_MAX 4
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -34,64 +34,64 @@
|
|||||||
// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
|
// - PORT_HIGHSPEED: mask to indicate which port support highspeed mode, bit0 for port0 and so on.
|
||||||
|
|
||||||
//------------- NXP -------------//
|
//------------- NXP -------------//
|
||||||
#if TU_CHECK_MCU(LPC175X_6X) || TU_CHECK_MCU(LPC177X_8X) || TU_CHECK_MCU(LPC40XX)
|
#if TU_CHECK_MCU(OPT_MCU_LPC175X_6X, OPT_MCU_LPC177X_8X, OPT_MCU_LPC40XX)
|
||||||
#define HCD_ATTR_OHCI
|
#define HCD_ATTR_OHCI
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC18XX) || TU_CHECK_MCU(LPC43XX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX)
|
||||||
#define HCD_ATTR_EHCI_TRANSDIMENSION
|
#define HCD_ATTR_EHCI_TRANSDIMENSION
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC54XXX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC54XXX)
|
||||||
// #define HCD_ATTR_EHCI_NXP_PTD
|
// #define HCD_ATTR_EHCI_NXP_PTD
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(LPC55XX)
|
#elif TU_CHECK_MCU(OPT_MCU_LPC55XX)
|
||||||
// #define HCD_ATTR_EHCI_NXP_PTD
|
// #define HCD_ATTR_EHCI_NXP_PTD
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(MIMXRT10XX)
|
#elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX)
|
||||||
#define HCD_ATTR_EHCI_TRANSDIMENSION
|
#define HCD_ATTR_EHCI_TRANSDIMENSION
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(MKL25ZXX)
|
#elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX)
|
||||||
|
|
||||||
//------------- Microchip -------------//
|
//------------- Microchip -------------//
|
||||||
#elif TU_CHECK_MCU(SAMD21) || TU_CHECK_MCU(SAMD51) || TU_CHECK_MCU(SAME5X) || \
|
#elif TU_CHECK_MCU(OPT_MCU_SAMD21, OPT_MCU_SAMD51, OPT_MCU_SAME5X) || \
|
||||||
TU_CHECK_MCU(SAMD11) || TU_CHECK_MCU(SAML21) || TU_CHECK_MCU(SAML22)
|
TU_CHECK_MCU(OPT_MCU_SAMD11, OPT_MCU_SAML21, OPT_MCU_SAML22)
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(SAMG)
|
#elif TU_CHECK_MCU(OPT_MCU_SAMG)
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(SAMX7X)
|
#elif TU_CHECK_MCU(OPT_MCU_SAMX7X)
|
||||||
|
|
||||||
//------------- ST -------------//
|
//------------- ST -------------//
|
||||||
#elif TU_CHECK_MCU(STM32F0) || TU_CHECK_MCU(STM32F1) || TU_CHECK_MCU(STM32F3) || \
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F1, OPT_MCU_STM32F3) || \
|
||||||
TU_CHECK_MCU(STM32L0) || TU_CHECK_MCU(STM32L1) || TU_CHECK_MCU(STM32L4)
|
TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1, OPT_MCU_STM32L4)
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F2) || TU_CHECK_MCU(STM32F4) || TU_CHECK_MCU(STM32F3)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F2, OPT_MCU_STM32F3, OPT_MCU_STM32F4)
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32F7)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32F7)
|
||||||
|
|
||||||
#elif TU_CHECK_MCU(STM32H7)
|
#elif TU_CHECK_MCU(OPT_MCU_STM32H7)
|
||||||
|
|
||||||
//------------- Sony -------------//
|
//------------- Sony -------------//
|
||||||
#elif TU_CHECK_MCU(CXD56)
|
#elif TU_CHECK_MCU(OPT_MCU_CXD56)
|
||||||
|
|
||||||
//------------- Nuvoton -------------//
|
//------------- Nuvoton -------------//
|
||||||
#elif TU_CHECK_MCU(NUC505)
|
#elif TU_CHECK_MCU(OPT_MCU_NUC505)
|
||||||
|
|
||||||
//------------- Espressif -------------//
|
//------------- Espressif -------------//
|
||||||
#elif TU_CHECK_MCU(ESP32S2) || TU_CHECK_MCU(ESP32S3)
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
|
|
||||||
//------------- Raspberry Pi -------------//
|
//------------- Raspberry Pi -------------//
|
||||||
#elif TU_CHECK_MCU(RP2040)
|
#elif TU_CHECK_MCU(OPT_MCU_RP2040)
|
||||||
|
|
||||||
//------------- Silabs -------------//
|
//------------- Silabs -------------//
|
||||||
#elif TU_CHECK_MCU(EFM32GG) || TU_CHECK_MCU(EFM32GG11) || TU_CHECK_MCU(EFM32GG12)
|
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_EFM32GG11, OPT_MCU_EFM32GG12)
|
||||||
|
|
||||||
//------------- Renesas -------------//
|
//------------- Renesas -------------//
|
||||||
#elif TU_CHECK_MCU(RX63X) || TU_CHECK_MCU(RX65X) || TU_CHECK_MCU(RX72N)
|
#elif TU_CHECK_MCU(OPT_MCU_RX63X, OPT_MCU_RX65X, OPT_MCU_RX72N)
|
||||||
|
|
||||||
//#elif TU_CHECK_MCU(MM32F327X)
|
//#elif TU_CHECK_MCU(OPT_MCU_MM32F327X)
|
||||||
// #define DCD_ATTR_ENDPOINT_MAX not known yet
|
// #define DCD_ATTR_ENDPOINT_MAX not known yet
|
||||||
|
|
||||||
//------------- GigaDevice -------------//
|
//------------- GigaDevice -------------//
|
||||||
#elif TU_CHECK_MCU(GD32VF103)
|
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// #warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
|
// #warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8"
|
||||||
|
@ -109,13 +109,10 @@
|
|||||||
#define STM32F1_FSDEV
|
#define STM32F1_FSDEV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (TUSB_OPT_DEVICE_ENABLED) && ( \
|
#if TUSB_OPT_DEVICE_ENABLED && \
|
||||||
(CFG_TUSB_MCU == OPT_MCU_STM32F0 ) || \
|
( TU_CHECK_MCU(OPT_MCU_STM32F0, OPT_MCU_STM32F3, OPT_MCU_STM32L0, OPT_MCU_STM32L1) || \
|
||||||
(CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_FSDEV)) || \
|
(TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) \
|
||||||
(CFG_TUSB_MCU == OPT_MCU_STM32F3 ) || \
|
)
|
||||||
(CFG_TUSB_MCU == OPT_MCU_STM32L0 ) || \
|
|
||||||
(CFG_TUSB_MCU == OPT_MCU_STM32L1 ) \
|
|
||||||
)
|
|
||||||
|
|
||||||
// In order to reduce the dependance on HAL, we undefine this.
|
// In order to reduce the dependance on HAL, we undefine this.
|
||||||
// Some definitions are copied to our private include file.
|
// Some definitions are copied to our private include file.
|
||||||
|
@ -31,16 +31,16 @@
|
|||||||
#include "device/dcd_attr.h"
|
#include "device/dcd_attr.h"
|
||||||
|
|
||||||
#if TUSB_OPT_DEVICE_ENABLED && \
|
#if TUSB_OPT_DEVICE_ENABLED && \
|
||||||
( defined(DCD_ATTR_DWC2_STM32) || TU_CHECK_MCU(ESP32S2, ESP32S3, GD32VF103) )
|
( defined(DCD_ATTR_DWC2_STM32) || TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3, OPT_MCU_GD32VF103) )
|
||||||
|
|
||||||
#include "device/dcd.h"
|
#include "device/dcd.h"
|
||||||
#include "dwc2_type.h"
|
#include "dwc2_type.h"
|
||||||
|
|
||||||
#if defined(DCD_ATTR_DWC2_STM32)
|
#if defined(DCD_ATTR_DWC2_STM32)
|
||||||
#include "dwc2_stm32.h"
|
#include "dwc2_stm32.h"
|
||||||
#elif TU_CHECK_MCU(ESP32S2, ESP32S3)
|
#elif TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3)
|
||||||
#include "dwc2_esp32.h"
|
#include "dwc2_esp32.h"
|
||||||
#elif TU_CHECK_MCU(GD32VF103)
|
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
|
||||||
#include "dwc2_gd32.h"
|
#include "dwc2_gd32.h"
|
||||||
#else
|
#else
|
||||||
#error "Unsupported MCUs"
|
#error "Unsupported MCUs"
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
|
|
||||||
// Helper to check if configured MCU is one of listed
|
// Helper to check if configured MCU is one of listed
|
||||||
// Apply _TU_CHECK_MCU with || as separator to list of input
|
// Apply _TU_CHECK_MCU with || as separator to list of input
|
||||||
#define _TU_CHECK_MCU(_m) (CFG_TUSB_MCU == OPT_MCU_##_m)
|
#define _TU_CHECK_MCU(_m) (CFG_TUSB_MCU == _m)
|
||||||
#define TU_CHECK_MCU(...) (TU_ARGS_APPLY(_TU_CHECK_MCU, ||, __VA_ARGS__))
|
#define TU_CHECK_MCU(...) (TU_ARGS_APPLY(_TU_CHECK_MCU, ||, __VA_ARGS__))
|
||||||
|
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
Loading…
x
Reference in New Issue
Block a user