able to build freeRTOS with lpc175x_6x

This commit is contained in:
hathach
2014-03-03 16:25:34 +07:00
parent 6770a36cba
commit 22a84f744d
9 changed files with 2946 additions and 1301 deletions

View File

@@ -1,10 +1,14 @@
#ifndef __FREERTOS_CONFIG__H
#define __FREERTOS_CONFIG__H
#ifdef CORE_M4
#include "hal/hal.h"
#if __CORTEX_M == 4
#include "lpc43xx_m4_FreeRTOSConfig.h"
#elif defined(CORE_M0)
#elif __CORTEX_M == 0
#include "lpc43xx_m0_FreeRTOSConfig.h"
#elif __CORTEX_M == 3
#include "FreeRTOSConfig_lpc175x_6x.h"
#else
#error "For LPC43XX one of CORE_M0 or CORE_M4 must be defined!"
#endif /* ifdef CORE_M4 */

View File

@@ -55,25 +55,9 @@
#define FREERTOS_CONFIG_H
#include <stdint.h>
#include "hal/hal.h"
extern uint32_t SystemCoreClock;
/* Priorities to assign to tasks created by this demo. */
#define configUART_COMMAND_CONSOLE_TASK_PRIORITY ( 3U )
#define configSPI_7_SEG_WRITE_TASK_PRIORITY ( 2U )
#define configI2C_TASK_PRIORITY ( 0U )
/* Stack sizes to assign to tasks created by this demo. */
#define configUART_COMMAND_CONSOLE_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )
#define configSPI_7_SEG_WRITE_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 )
#define configI2C_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 3 )
/* Dimensions a buffer that can be used by the FreeRTOS+CLI command
interpreter. Set this value to 1 to save RAM if FreeRTOS+CLI does not supply
the output butter. See the FreeRTOS+CLI documentation for more information:
http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */
#define configCOMMAND_INT_MAX_OUTPUT_SIZE 1024
/*-----------------------------------------------------------
* Application specific definitions.
*
@@ -90,8 +74,8 @@ http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */
#define configCPU_CLOCK_HZ ( SystemCoreClock )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 90 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 15 * 1024 ) ) /* Has not effect in this demo as the heap is manually pointed to AHB RAM. */
#define configMAX_TASK_NAME_LEN ( 12 )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 16 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 32 )
#define configIDLE_SHOULD_YIELD 0
#define configQUEUE_REGISTRY_SIZE 10
#define configUSE_TRACE_FACILITY 1
@@ -111,17 +95,17 @@ http://www.FreeRTOS.org/FreeRTOS-Plus/FreeRTOS_Plus_CLI/ */
/* Software timer related definitions. */
#define configUSE_TIMERS 1
#define configUSE_TIMERS 0
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 3 )
#define configTIMER_QUEUE_LENGTH 10
#define configTIMER_TASK_STACK_DEPTH configMINIMAL_STACK_SIZE
/* Run time stats gathering definitions. */
void vMainConfigureTimerForRunTimeStats( void );
uint32_t ulMainGetRunTimeCounterValue( void );
#define configGENERATE_RUN_TIME_STATS 1
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats()
#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
//void vMainConfigureTimerForRunTimeStats( void );
//uint32_t ulMainGetRunTimeCounterValue( void );
//#define configGENERATE_RUN_TIME_STATS 1
//#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vMainConfigureTimerForRunTimeStats()
//#define portGET_RUN_TIME_COUNTER_VALUE() ulMainGetRunTimeCounterValue()
/* Set the following definitions to 1 to include the API function, or zero

View File

@@ -318,8 +318,10 @@
#include "tusb_option.h"
#ifdef __GNUC__
#if TUSB_CFG_MCU==MCU_LPC43XX // TODO M0 M4
#if __CORTEX_M == 4 // TODO M0 M4
#include "../portable/GCC/ARM_CM4F/portmacro.h"
#elif __CORTEX_M == 3
#include "../portable/GCC/ARM_CM3/portmacro.h"
#else
#error portmacro.h for mcu is not supported yet
#endif

View File

@@ -120,8 +120,7 @@ to exclude the API function. */
/* Cortex-M specific definitions. */
#ifdef __NVIC_PRIO_BITS
/* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
#define configPRIO_BITS __NVIC_PRIO_BITS
#define configPRIO_BITS __NVIC_PRIO_BITS
#else
#define configPRIO_BITS 5 /* 32 priority levels */
#endif