From 8418cb26d2ac76285b50a810e719c19b681ac64a Mon Sep 17 00:00:00 2001 From: Dong Heng Date: Fri, 27 Apr 2018 16:47:36 +0800 Subject: [PATCH] feat(freertos): Make components compiling OK --- components/freertos/component.mk | 2 +- components/freertos/freertos/tasks.c | 4 ++-- components/freertos/include/freertos/private/portable.h | 4 ++-- .../freertos/include/port/freertos/FreeRTOSConfig.h | 2 +- components/freertos/include/port/freertos/portmacro.h | 7 ++++++- components/freertos/port/heap_5.c | 8 -------- 6 files changed, 12 insertions(+), 15 deletions(-) diff --git a/components/freertos/component.mk b/components/freertos/component.mk index 2e271bae..7d7f6945 100644 --- a/components/freertos/component.mk +++ b/components/freertos/component.mk @@ -1,6 +1,6 @@ # Component Makefile # -COMPONENT_ADD_INCLUDEDIRS += include include/freertos include/port include/port/freertos +COMPONENT_ADD_INCLUDEDIRS += include include/freertos include/freertos/private include/port include/port/freertos COMPONENT_SRCDIRS := freertos port diff --git a/components/freertos/freertos/tasks.c b/components/freertos/freertos/tasks.c index 20c39626..4325c9b1 100644 --- a/components/freertos/freertos/tasks.c +++ b/components/freertos/freertos/tasks.c @@ -524,7 +524,7 @@ static void prvAddCurrentTaskToDelayedList( TickType_t xTicksToWait, const BaseT */ #if ( configUSE_TICKLESS_IDLE != 0 ) - static TickType_t prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION; + TickType_t prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION; #endif @@ -2041,7 +2041,7 @@ void vTaskSuspendAll( void ) #if ( configUSE_TICKLESS_IDLE != 0 ) - static TickType_t prvGetExpectedIdleTime( void ) + TickType_t prvGetExpectedIdleTime( void ) { TickType_t xReturn; UBaseType_t uxHigherPriorityReadyTasks = pdFALSE; diff --git a/components/freertos/include/freertos/private/portable.h b/components/freertos/include/freertos/private/portable.h index 3d0ef0a6..e8011134 100644 --- a/components/freertos/include/freertos/private/portable.h +++ b/components/freertos/include/freertos/private/portable.h @@ -126,8 +126,8 @@ void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEG /* * Map to the memory management routines required for the port. */ -void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION; -void vPortFree( void *pv ) PRIVILEGED_FUNCTION; +//void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION; +//void vPortFree( void *pv ) PRIVILEGED_FUNCTION; void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; diff --git a/components/freertos/include/port/freertos/FreeRTOSConfig.h b/components/freertos/include/port/freertos/FreeRTOSConfig.h index 520e1d48..89deb9a3 100644 --- a/components/freertos/include/port/freertos/FreeRTOSConfig.h +++ b/components/freertos/include/port/freertos/FreeRTOSConfig.h @@ -83,7 +83,7 @@ #define configUSE_TICKLESS_IDLE 1 #define configCPU_CLOCK_HZ ( ( unsigned long ) 80000000 ) #define configTICK_RATE_HZ ( ( portTickType ) 100 ) -#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 15 ) +#define configMAX_PRIORITIES 15 #define configMINIMAL_STACK_SIZE ( ( unsigned short )176 ) //#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 17 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) diff --git a/components/freertos/include/port/freertos/portmacro.h b/components/freertos/include/port/freertos/portmacro.h index 641c1081..9c60a8fd 100644 --- a/components/freertos/include/port/freertos/portmacro.h +++ b/components/freertos/include/port/freertos/portmacro.h @@ -96,6 +96,11 @@ extern "C" { #define portSTACK_TYPE unsigned portLONG #define portBASE_TYPE long +#define BaseType_t portBASE_TYPE +#define TickType_t unsigned portLONG +#define UBaseType_t unsigned portBASE_TYPE +#define StackType_t portSTACK_TYPE + typedef unsigned portLONG portTickType; typedef unsigned int INT32U; #define portMAX_DELAY ( portTickType ) 0xffffffff @@ -103,7 +108,7 @@ typedef unsigned int INT32U; /* Architecture specifics. */ #define portSTACK_GROWTH ( -1 ) -#define portTICK_RATE_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) +#define portTICK_PERIOD_MS ( ( portTickType ) 1000 / configTICK_RATE_HZ ) #define portBYTE_ALIGNMENT 8 /*-----------------------------------------------------------*/ diff --git a/components/freertos/port/heap_5.c b/components/freertos/port/heap_5.c index 74a9b72a..7700ec56 100644 --- a/components/freertos/port/heap_5.c +++ b/components/freertos/port/heap_5.c @@ -147,14 +147,6 @@ typedef struct A_BLOCK_LINK #endif } BlockLink_t; - -/* Used by heap_5.c. */ -typedef struct HeapRegion -{ - uint8_t *pucStartAddress; - size_t xSizeInBytes; -} HeapRegion_t; - /*-----------------------------------------------------------*/ /*