mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-17 05:32:55 +08:00
rename MCU_ to OPT_MCU
This commit is contained in:
parent
18f97fef7e
commit
e1272159d8
@ -76,31 +76,31 @@
|
||||
//--------------------------------------------------------------------+
|
||||
#ifdef __CODE_RED // compiled with lpcxpresso
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif CFG_TUSB_MCU == MCU_LPC175X_6X
|
||||
#elif CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
|
||||
#endif
|
||||
|
||||
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
|
||||
#endif
|
||||
|
||||
#elif defined __ICCARM__ // compiled with IAR
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
#define CFG_TUSB_ATTR_USBRAM
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
|
||||
#endif
|
||||
|
||||
|
@ -63,7 +63,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
|
||||
|
@ -76,7 +76,7 @@
|
||||
#define CFG_TUSB_ATTR_USBRAM
|
||||
|
||||
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
|
||||
#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 CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(64)
|
||||
#elif defined NRF52840_XXAA
|
||||
#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
|
||||
|
@ -63,7 +63,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
|
||||
|
@ -76,31 +76,31 @@
|
||||
//--------------------------------------------------------------------+
|
||||
#ifdef __CODE_RED // compiled with lpcxpresso
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM2) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif CFG_TUSB_MCU == MCU_LPC175X_6X
|
||||
#elif CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
|
||||
#endif
|
||||
|
||||
#elif defined __CC_ARM // Compiled with Keil armcc, USBRAM_SECTION is defined in scatter files
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM ATTR_SECTION(USBRAM_SECTION) ATTR_ALIGNED(64) // lp11u & lp13u requires data to be 64 byte aligned
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
|
||||
#endif
|
||||
|
||||
#elif defined __ICCARM__ // compiled with IAR
|
||||
|
||||
#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 CFG_TUSB_ATTR_USBRAM _Pragma("location=\"USB_PACKET_MEMORY\"") ATTR_ALIGNED(64)
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
#define CFG_TUSB_ATTR_USBRAM
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
|
||||
#endif
|
||||
|
||||
@ -111,7 +111,7 @@
|
||||
#endif
|
||||
|
||||
// LPC11uxx and LPC13uxx requires each buffer has to be 64-byte alignment
|
||||
#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 CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(64)
|
||||
#elif defined NRF52840_XXAA
|
||||
#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
|
||||
|
@ -65,7 +65,7 @@
|
||||
#define ITF_TOTAL (2*CFG_TUSB_DEVICE_CDC + CFG_TUSB_DEVICE_HID_KEYBOARD + CFG_TUSB_DEVICE_HID_MOUSE + \
|
||||
CFG_TUSB_DEVICE_HID_GENERIC + CFG_TUSB_DEVICE_MSC)
|
||||
|
||||
#if (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX) && (ITF_TOTAL > 4)
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13UXX) && (ITF_TOTAL > 4)
|
||||
#error These MCUs do not have enough number of endpoints for the current configuration
|
||||
#endif
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
#define EDPT_IN(x) (0x80 | (x))
|
||||
#define EDPT_OUT(x) (x)
|
||||
|
||||
#if CFG_TUSB_MCU == MCU_LPC175X_6X // MCUs's endpoint number has a fixed type
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X // MCUs's endpoint number has a fixed type
|
||||
|
||||
//------------- CDC -------------//
|
||||
#define CDC_EDPT_NOTIF EDPT_IN (1)
|
||||
@ -125,7 +125,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#define MSC_EDPT_PACKETSIZE (CFG_TUSB_MCU == MCU_LPC43XX ? 512 : 64)
|
||||
#define MSC_EDPT_PACKETSIZE (CFG_TUSB_MCU == OPT_MCU_LPC43XX ? 512 : 64)
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// CONFIGURATION DESCRIPTOR
|
||||
|
@ -76,26 +76,26 @@
|
||||
//--------------------------------------------------------------------+
|
||||
#ifdef __CODE_RED // make use of code red's support for ram region macros
|
||||
|
||||
#if CFG_TUSB_MCU == MCU_LPC175X_6X
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM ATTR_SECTION(.data.$RAM3)
|
||||
#endif
|
||||
|
||||
#elif defined __CC_ARM // Compiled with Keil armcc
|
||||
|
||||
#if (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
#define CFG_TUSB_ATTR_USBRAM // LPC17xx USB DMA can access all address
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM // Use keil tool configure to have AHB SRAM as default memory
|
||||
#endif
|
||||
|
||||
#elif defined __ICCARM__ // compiled with IAR
|
||||
|
||||
#if (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
// LP175x_6x can access all but CMSIS-RTX causes overflow in 32KB SRAM --> move to AHB ram
|
||||
#define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".sram\"")
|
||||
#elif (CFG_TUSB_MCU == MCU_LPC43XX)
|
||||
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
|
||||
#define CFG_TUSB_ATTR_USBRAM _Pragma("location=\".ahb_sram1\"")
|
||||
#endif
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "common/tusb_common.h"
|
||||
#include "hal.h"
|
||||
|
||||
#if CFG_TUSB_MCU == MCU_LPC11UXX
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC11UXX
|
||||
|
||||
void tusb_hal_int_enable(uint8_t rhport)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@
|
||||
#include "common/tusb_common.h"
|
||||
#include "hal.h"
|
||||
|
||||
#if CFG_TUSB_MCU == MCU_LPC13UXX
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC13UXX
|
||||
|
||||
void tusb_hal_int_enable(uint8_t rhport)
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ typedef struct {
|
||||
uint8_t scsi_data[64];
|
||||
CFG_TUSB_MEM_ALIGN msc_cbw_t cbw;
|
||||
|
||||
#if defined (__ICCARM__) && (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX)
|
||||
#if defined (__ICCARM__) && (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13UXX)
|
||||
uint8_t padding1[64-sizeof(msc_cbw_t)]; // IAR cannot align struct's member
|
||||
#endif
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "common/tusb_common.h"
|
||||
|
||||
#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC43XX || CFG_TUSB_MCU == MCU_LPC18XX)
|
||||
#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == OPT_MCU_LPC43XX || CFG_TUSB_MCU == OPT_MCU_LPC18XX)
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include <common/tusb_common.h>
|
||||
|
||||
#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#if MODE_HOST_SUPPORTED && (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "tusb_option.h"
|
||||
|
||||
#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC11UXX || CFG_TUSB_MCU == MCU_LPC13UXX)
|
||||
#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == OPT_MCU_LPC11UXX || CFG_TUSB_MCU == OPT_MCU_LPC13UXX)
|
||||
|
||||
#define _TINY_USB_SOURCE_FILE_
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
#define DCD_11U_13U_QHD_COUNT 10
|
||||
|
||||
enum {
|
||||
DCD_11U_13U_MAX_BYTE_PER_TD = (CFG_TUSB_MCU == MCU_LPC11UXX ? 64 : 1023)
|
||||
DCD_11U_13U_MAX_BYTE_PER_TD = (CFG_TUSB_MCU == OPT_MCU_LPC11UXX ? 64 : 1023)
|
||||
};
|
||||
|
||||
#ifdef __CC_ARM
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "tusb_option.h"
|
||||
|
||||
#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == MCU_LPC175X_6X)
|
||||
#if MODE_DEVICE_SUPPORTED && (CFG_TUSB_MCU == OPT_MCU_LPC175X_6X)
|
||||
|
||||
#define _TINY_USB_SOURCE_FILE_
|
||||
//--------------------------------------------------------------------+
|
||||
|
@ -37,7 +37,7 @@
|
||||
/**************************************************************************/
|
||||
|
||||
#include "common/tusb_common.h"
|
||||
#if CFG_TUSB_MCU == MCU_LPC175X_6X
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
|
||||
#include "hal_usb.h"
|
||||
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "tusb_option.h"
|
||||
|
||||
#if MODE_DEVICE_SUPPORTED && CFG_TUSB_MCU == MCU_LPC43XX
|
||||
#if MODE_DEVICE_SUPPORTED && CFG_TUSB_MCU == OPT_MCU_LPC43XX
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDE
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include "tusb.h"
|
||||
|
||||
#if CFG_TUSB_MCU == MCU_LPC43XX
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX
|
||||
|
||||
#include "LPC43xx.h"
|
||||
#include "lpc43xx_cgu.h"
|
||||
|
@ -49,13 +49,15 @@
|
||||
/** \defgroup group_mcu Supported MCU
|
||||
* \ref CFG_TUSB_MCU must be defined to one of these
|
||||
* @{ */
|
||||
#define MCU_LPC11UXX 1 ///< NXP LPC11Uxx family
|
||||
#define MCU_LPC13XX 2 ///< NXP LPC13xx (not supported yet)
|
||||
#define MCU_LPC13UXX 3 ///< NXP LPC13xx 12 bit ADC family
|
||||
#define MCU_LPC175X_6X 4 ///< NXP LPC175x, LPC176x family
|
||||
#define MCU_LPC177X_8X 5 ///< NXP LPC177x, LPC178x family (not supported yet)
|
||||
#define MCU_LPC18XX 6 ///< NXP LPC18xx family (not supported yet)
|
||||
#define MCU_LPC43XX 7 ///< NXP LPC43xx family
|
||||
#define OPT_MCU_LPC11UXX 1 ///< NXP LPC11Uxx series
|
||||
#define OPT_MCU_LPC13XX 2 ///< NXP LPC13xx (not supported yet)
|
||||
#define OPT_MCU_LPC13UXX 3 ///< NXP LPC13xx 12 bit ADC series
|
||||
#define OPT_MCU_LPC175X_6X 4 ///< NXP LPC175x, LPC176x series
|
||||
#define OPT_MCU_LPC177X_8X 5 ///< NXP LPC177x, LPC178x series (not supported yet)
|
||||
#define OPT_MCU_LPC18XX 6 ///< NXP LPC18xx series (not supported yet)
|
||||
#define OPT_MCU_LPC43XX 7 ///< NXP LPC43xx series
|
||||
|
||||
#define OPT_MCU_NRF5X 100 ///< Nordic nRF5x series
|
||||
/** @} */
|
||||
|
||||
/** \defgroup group_supported_os Supported RTOS
|
||||
|
2
vendor/freertos/FreeRTOSConfig.h
vendored
2
vendor/freertos/FreeRTOSConfig.h
vendored
@ -4,7 +4,7 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// See http://www.freertos.org/a00110.html.
|
||||
//--------------------------------------------------------------------+
|
||||
#if CFG_TUSB_MCU == MCU_LPC43XX
|
||||
#if CFG_TUSB_MCU == OPT_MCU_LPC43XX
|
||||
// TODO remove
|
||||
#include "lpc43xx_cgu.h"
|
||||
#define configCPU_CLOCK_HZ CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user