diff options
| author | hathach <[email protected]> | 2014-04-28 11:51:10 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2014-04-28 14:20:00 +0700 |
| commit | 05c767313d0efd10d5b07b5b2f9b3d69a361075d (patch) | |
| tree | ced61eeb3c9ef7b170aaad9eca51c75e6ba84648 /vendor | |
| parent | b5a5b4152e6fd58c1e7b5052ec5cd0c13eea1608 (diff) | |
make freertos source unmodified to ease the upgrade process later
use CGU_GetPCLKFrequency as configCPU_CLOCK_HZ for lpc43xx using with freeRTOS
move portmarco.h include to FreeRTOSConfig.h to have untouched version of freertos
add a readme.md to vendor/freertos
refractor usbh.c, increase POWER_STABLE_DELAY = 500, RESET_DELAY = 200
fix bug with hub, only handle 1 port at a time when reading hub status change endpoint --> other port will be handled in the next cycle
Diffstat (limited to 'vendor')
| -rw-r--r-- | vendor/freertos/FreeRTOSConfig.h | 31 | ||||
| -rw-r--r-- | vendor/freertos/freertos/Source/include/portable.h | 38 | ||||
| -rw-r--r-- | vendor/freertos/readme.md | 4 |
3 files changed, 28 insertions, 45 deletions
diff --git a/vendor/freertos/FreeRTOSConfig.h b/vendor/freertos/FreeRTOSConfig.h index e23782346..36246e853 100644 --- a/vendor/freertos/FreeRTOSConfig.h +++ b/vendor/freertos/FreeRTOSConfig.h @@ -10,9 +10,13 @@ //--------------------------------------------------------------------+ // See http://www.freertos.org/a00110.html. //--------------------------------------------------------------------+ +#if TUSB_CFG_MCU == MCU_LPC43XX + #define configCPU_CLOCK_HZ CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE) +#else + #define configCPU_CLOCK_HZ SystemCoreClock +#endif + #define configUSE_PREEMPTION 1 -#define configCPU_CLOCK_HZ ( SystemCoreClock ) -//#define configCPU_CLOCK_HZ ( CGU_GetPCLKFrequency(CGU_PERIPHERAL_M4CORE)) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 8 ) #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) @@ -100,16 +104,29 @@ to all Cortex-M ports, and do not rely on any particular library functions. */ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) -#if 0 -#if __CORTEX_M == 4 +//--------------------------------------------------------------------+ +// portmacro.h include path +//--------------------------------------------------------------------+ +#if defined __CC_ARM + #define TOOL_DIR RVDS +#elif defined __GNUC__ + #define TOOL_DIR GCC +#elif defined __ICCARM__ + #define TOOL_DIR IAR +#else + #error "not yet supported toolchain" +#endif +#if __CORTEX_M == 4 + #define ARCH_DIR ARM_CM4F #elif __CORTEX_M == 3 - + #define ARCH_DIR ARM_CM3 #elif __CORTEX_M == 0 - + #define ARCH_DIR ARM_CM0 #else #error "not yet supported MCU" #endif -#endif + +#include XSTRING_(freertos/Source/portable/TOOL_DIR/ARCH_DIR/portmacro.h) #endif /* __FREERTOS_CONFIG__H */ diff --git a/vendor/freertos/freertos/Source/include/portable.h b/vendor/freertos/freertos/Source/include/portable.h index 235cab0da..cb3bacbab 100644 --- a/vendor/freertos/freertos/Source/include/portable.h +++ b/vendor/freertos/freertos/Source/include/portable.h @@ -70,44 +70,6 @@ #ifndef PORTABLE_H
#define PORTABLE_H
-//--------------------------------------------------------------------+
-// TinyUSB modification
-//--------------------------------------------------------------------+
-#if defined __CC_ARM
- #if __CORTEX_M == 4 // TODO M0 M4
- #define PORTMACRO_PATH "../portable/RVDS/ARM_CM4F/portmacro.h"
- #elif __CORTEX_M == 3
- #define PORTMACRO_PATH "../portable/RVDS/ARM_CM3/portmacro.h"
- #elif __CORTEX_M == 0
- #define PORTMACRO_PATH "../portable/RVDS/ARM_CM0/portmacro.h"
- #endif
-
-#elif defined __GNUC__
- #if __CORTEX_M == 4
- #define PORTMACRO_PATH "../portable/GCC/ARM_CM4F/portmacro.h"
- #elif __CORTEX_M == 3
- #define PORTMACRO_PATH "../portable/GCC/ARM_CM3/portmacro.h"
- #elif __CORTEX_M == 0
- #define PORTMACRO_PATH "../portable/GCC/ARM_CM0/portmacro.h"
- #endif
-
-#elif defined __ICCARM__
- #if __CORTEX_M == 4
- #define PORTMACRO_PATH "../portable/IAR/ARM_CM4F/portmacro.h"
- #elif __CORTEX_M == 3
- #define PORTMACRO_PATH "../portable/IAR/ARM_CM3/portmacro.h"
- #elif __CORTEX_M == 0
- #define PORTMACRO_PATH "../portable/IAR/ARM_CM0/portmacro.h"
- #endif
-
-#endif
-
-#ifndef PORTMACRO_PATH
- #error portmacro.h path is not defined for this toolchain and/or MCU
-#endif
-
-#include PORTMACRO_PATH
-
/* Include the macro file relevant to the port being used. */
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
diff --git a/vendor/freertos/readme.md b/vendor/freertos/readme.md new file mode 100644 index 000000000..b751754cf --- /dev/null +++ b/vendor/freertos/readme.md @@ -0,0 +1,4 @@ +This folder contains +- **FreeRTOSConfig.h** configuration file for freeRTOS +- **freertos_hook.c** implemenation of freeRTOS to application hooks +- **freertos** an *unmodified copy* of the popular open source FreeRTOS. This will help to ease the upgrade to later version. However, due to Keil unable to have duplicated filenames, I have to change the name of port.c in freertos/Source/portable/RVDS for example ARM_CM3/port.c to ARM_CM3/port_cm3.c to have ability to support/switch among different mcu in one project.
\ No newline at end of file |
