1230 lines
47 KiB
Diff
1230 lines
47 KiB
Diff
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: croutine.o
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: event_groups.o
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/include/FreeRTOS.h lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/include/FreeRTOS.h
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/include/FreeRTOS.h 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/include/FreeRTOS.h 2024-11-27 13:57:10.357907921 +0600
|
|
@@ -615,6 +615,10 @@
|
|
|
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
|
|
|
|
+ #ifndef configUSE_STATS_FORMATTING_FUNCTIONS
|
|
+ #define configUSE_STATS_FORMATTING_FUNCTIONS 1
|
|
+ #endif
|
|
+
|
|
#ifndef portCONFIGURE_TIMER_FOR_RUN_TIME_STATS
|
|
#error If configGENERATE_RUN_TIME_STATS is defined then portCONFIGURE_TIMER_FOR_RUN_TIME_STATS must also be defined. portCONFIGURE_TIMER_FOR_RUN_TIME_STATS should call a port layer function to setup a peripheral timer/counter that can then be used as the run time counter time base.
|
|
#endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/include/task.h lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/include/task.h
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/include/task.h 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/include/task.h 2024-11-27 13:57:10.357907921 +0600
|
|
@@ -158,6 +158,9 @@
|
|
UBaseType_t uxCurrentPriority; /* The priority at which the task was running (may be inherited) when the structure was populated. */
|
|
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
|
|
uint32_t ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See http://www.freertos.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
|
|
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
+ uint32_t ulDelataRunTimeCounterOfPeroid;/* The delta run time counter in a sample peroid*/
|
|
+#endif
|
|
uint16_t usStackHighWaterMark; /* The minimum amount of stack space that has remained for the task since the task was created. The closer this value is to zero the closer the task has come to overflowing its stack. */
|
|
} TaskStatus_t;
|
|
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: list.o
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: Makefile
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: BCC
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: CCS
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: CodeWarrior
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM7_AT91FR40008
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM7_AT91SAM7S
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM7_LPC2000
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM7_LPC23xx
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM_CA9
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ARM_CM0
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM3: Makefile
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM3/port.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM3/port.c 2024-11-27 13:57:10.357907921 +0600
|
|
@@ -723,23 +723,24 @@
|
|
|
|
#endif /* configASSERT_DEFINED */
|
|
|
|
+/*-----------------------------------------------------------*/
|
|
+void vApplicationIdleHook( void )
|
|
+{
|
|
+ /* Use the idle task to place the CPU into a low power mode. Greater power
|
|
+ saving could be achieved by not including any demo tasks that never block. */
|
|
+}
|
|
+
|
|
+#include "diag.h"
|
|
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
|
+{
|
|
+ /* This function will be called if a task overflows its stack, if
|
|
+ configCHECK_FOR_STACK_OVERFLOW != 0. It might be that the function
|
|
+ parameters have been corrupted, depending on the severity of the stack
|
|
+ overflow. When this is the case pxCurrentTCB can be inspected in the
|
|
+ debugger to find the offending task. */
|
|
+ DiagPrintf("\n\r[%s] STACK OVERFLOW - TaskName(%s)\n\r", __FUNCTION__, pcTaskName);
|
|
+ for( ;; );
|
|
+}
|
|
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
-
|
|
+/*-----------------------------------------------------------*/
|
|
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F: Makefile
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F/port.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F/port.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -781,4 +781,24 @@
|
|
|
|
#endif /* configASSERT_DEFINED */
|
|
|
|
+/*-----------------------------------------------------------*/
|
|
+void vApplicationIdleHook( void )
|
|
+{
|
|
+ /* Use the idle task to place the CPU into a low power mode. Greater power
|
|
+ saving could be achieved by not including any demo tasks that never block. */
|
|
+}
|
|
+
|
|
+#include "diag.h"
|
|
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
|
+{
|
|
+ /* This function will be called if a task overflows its stack, if
|
|
+ configCHECK_FOR_STACK_OVERFLOW != 0. It might be that the function
|
|
+ parameters have been corrupted, depending on the severity of the stack
|
|
+ overflow. When this is the case pxCurrentTCB can be inspected in the
|
|
+ debugger to find the offending task. */
|
|
+ DiagPrintf("\n\r[%s] STACK OVERFLOW - TaskName(%s)\n\r", __FUNCTION__, pcTaskName);
|
|
+ for( ;; );
|
|
+}
|
|
+
|
|
+/*-----------------------------------------------------------*/
|
|
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/GCC/ARM_CM4F: port.o
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ATMega323
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: AVR32_UC3
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: ColdFire_V2
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: CORTUS_APS3
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: H8S2329
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: HCS12
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: MCF5235
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: MicroBlaze
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: MicroBlazeV8
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: MSP430F449
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: NiosII
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: PPC405_Xilinx
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: PPC440_Xilinx
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: RL78
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: RX100
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: RX600
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: RX600v2
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: STR75x
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/GCC: TriCore_1782
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: 78K0R
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: ARM_CA5_No_GIC
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: ARM_CA9
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: ARM_CM0
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM3/port.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM3/port.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM3/port.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -74,6 +74,9 @@
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
+/* Platform includes */
|
|
+#include "platform_autoconf.h"
|
|
+
|
|
#if configMAX_SYSCALL_INTERRUPT_PRIORITY == 0
|
|
#error configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to 0. See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html
|
|
#endif
|
|
@@ -533,7 +536,12 @@
|
|
#if configUSE_TICKLESS_IDLE == 1
|
|
{
|
|
ulTimerCountsForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ );
|
|
+#ifdef CONFIG_SOC_PS_MODULE
|
|
+ // RTK modified: max system timer can sleep up to 8355ms, set it to 8000
|
|
+ xMaximumPossibleSuppressedTicks = 8000;
|
|
+#else // Below is original code. It can only sleep 100ms in 166MHz
|
|
xMaximumPossibleSuppressedTicks = portMAX_24_BIT_NUMBER / ulTimerCountsForOneTick;
|
|
+#endif
|
|
ulStoppedTimerCompensation = portMISSED_COUNTS_FACTOR / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );
|
|
}
|
|
#endif /* configUSE_TICKLESS_IDLE */
|
|
@@ -604,6 +612,29 @@
|
|
|
|
#endif /* configASSERT_DEFINED */
|
|
|
|
+/*-----------------------------------------------------------*/
|
|
+void vApplicationIdleHook( void )
|
|
+{
|
|
+ /* Use the idle task to place the CPU into a low power mode. Greater power
|
|
+ saving could be achieved by not including any demo tasks that never block. */
|
|
+}
|
|
+
|
|
+#include <platform_stdlib.h>
|
|
+
|
|
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
|
+{
|
|
+ /* This function will be called if a task overflows its stack, if
|
|
+ configCHECK_FOR_STACK_OVERFLOW != 0. It might be that the function
|
|
+ parameters have been corrupted, depending on the severity of the stack
|
|
+ overflow. When this is the case pxCurrentTCB can be inspected in the
|
|
+ debugger to find the offending task. */
|
|
+ printf("\n\r[%s] STACK OVERFLOW - TaskName(%s)\n\r", __FUNCTION__, pcTaskName);
|
|
+ for( ;; );
|
|
+}
|
|
+
|
|
+/*-----------------------------------------------------------*/
|
|
+
|
|
+
|
|
|
|
|
|
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM3/portmacro.h
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM3/portmacro.h 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -71,6 +71,24 @@
|
|
extern "C" {
|
|
#endif
|
|
|
|
+#ifdef CONFIG_PLATFORM_8195A
|
|
+// to prevent marco define use in standard header file
|
|
+#define _NO_DEFINITIONS_IN_HEADER_FILES
|
|
+#include <string.h>
|
|
+//#include "basic_types.h"
|
|
+#include "hal_misc.h"
|
|
+#if !defined(__IARSTDLIB__)
|
|
+#ifndef memcmp
|
|
+#define memcmp(dst, src, sz) _memcmp(dst, src, sz)
|
|
+#endif
|
|
+#ifndef memset
|
|
+#define memset(dst, val, sz) _memset(dst, val, sz)
|
|
+#endif
|
|
+#ifndef memcpy
|
|
+#define memcpy(dst, src, sz) _memcpy(dst, src, sz)
|
|
+#endif
|
|
+#endif
|
|
+#endif
|
|
/*-----------------------------------------------------------
|
|
* Port specific definitions.
|
|
*
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM4F/port.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/IAR/ARM_CM4F/port.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -630,7 +630,21 @@
|
|
|
|
#endif /* configASSERT_DEFINED */
|
|
|
|
-
|
|
+/*-----------------------------------------------------------*/
|
|
+void vApplicationIdleHook( void )
|
|
+{
|
|
+ /* Use the idle task to place the CPU into a low power mode. Greater power
|
|
+ saving could be achieved by not including any demo tasks that never block. */
|
|
+}
|
|
+
|
|
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
|
+{
|
|
+ /* This function will be called if a task overflows its stack, if
|
|
+ configCHECK_FOR_STACK_OVERFLOW != 0 */
|
|
+
|
|
+ printf("\n\r[%s] STACK OVERFLOW - TaskName(%s)\n\r", __FUNCTION__, pcTaskName);
|
|
+ for( ;; );
|
|
+}
|
|
|
|
|
|
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: ATMega323
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: AtmelSAM7S64
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: AtmelSAM9XE
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: AVR32_UC3
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: LPC2000
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: MSP430
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: MSP430X
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: RL78
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: RX100
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: RX600
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: STR71x
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: STR75x
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: STR91x
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/IAR: V850ES
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Keil
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/MemMang/heap_4.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang/heap_4.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/MemMang/heap_4.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang/heap_4.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -81,6 +81,7 @@
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
+
|
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
|
|
|
/* Block sizes must not get too small. */
|
|
@@ -90,6 +91,12 @@
|
|
#define heapBITS_PER_BYTE ( ( size_t ) 8 )
|
|
|
|
/* Allocate the memory for the heap. */
|
|
+//TODO: remove section when combine BD and BF
|
|
+#if ((defined CONFIG_PLATFORM_8195A) || (defined CONFIG_PLATFORM_8711B))
|
|
+#include "section_config.h"
|
|
+SRAM_BF_DATA_SECTION
|
|
+#endif
|
|
+
|
|
static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ];
|
|
|
|
/* Define the linked list structure. This is used to link free blocks in order
|
|
@@ -288,7 +295,7 @@
|
|
}
|
|
/*-----------------------------------------------------------*/
|
|
|
|
-void vPortFree( void *pv )
|
|
+void __vPortFree( void *pv )
|
|
{
|
|
uint8_t *puc = ( uint8_t * ) pv;
|
|
BlockLink_t *pxLink;
|
|
@@ -335,6 +342,27 @@
|
|
}
|
|
}
|
|
/*-----------------------------------------------------------*/
|
|
+/* Add by Alfa 2015/02/04 -----------------------------------*/
|
|
+static void (*ext_free)( void *p ) = NULL;
|
|
+static uint32_t ext_upper = 0;
|
|
+static uint32_t ext_lower = 0;
|
|
+void vPortSetExtFree( void (*free)( void *p ), uint32_t upper, uint32_t lower )
|
|
+{
|
|
+ ext_free = free;
|
|
+ ext_upper = upper;
|
|
+ ext_lower = lower;
|
|
+}
|
|
+
|
|
+void vPortFree( void *pv )
|
|
+{
|
|
+ if( ((uint32_t)pv >= ext_lower) && ((uint32_t)pv < ext_upper) ){
|
|
+ // use external free function
|
|
+ if( ext_free ) ext_free( pv );
|
|
+ }else
|
|
+ __vPortFree( pv );
|
|
+}
|
|
+
|
|
+/*-----------------------------------------------------------*/
|
|
|
|
size_t xPortGetFreeHeapSize( void )
|
|
{
|
|
@@ -462,3 +490,55 @@
|
|
}
|
|
}
|
|
|
|
+void* pvPortReAlloc( void *pv, size_t xWantedSize )
|
|
+{
|
|
+ BlockLink_t *pxLink;
|
|
+
|
|
+ if( ((uint32_t)pv >= ext_lower) && ((uint32_t)pv < ext_upper) ){
|
|
+ if( ext_free ) ext_free( pv );
|
|
+ pv = NULL;
|
|
+ }
|
|
+
|
|
+ unsigned char *puc = ( unsigned char * ) pv;
|
|
+
|
|
+ if( pv )
|
|
+ {
|
|
+ if( !xWantedSize )
|
|
+ {
|
|
+ vPortFree( pv );
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
+ void *newArea = pvPortMalloc( xWantedSize );
|
|
+ if( newArea )
|
|
+ {
|
|
+ /* The memory being freed will have an xBlockLink structure immediately
|
|
+ before it. */
|
|
+ puc -= xHeapStructSize;
|
|
+
|
|
+ /* This casting is to keep the compiler from issuing warnings. */
|
|
+ pxLink = ( void * ) puc;
|
|
+
|
|
+ int oldSize = (pxLink->xBlockSize & ~xBlockAllocatedBit) - xHeapStructSize;
|
|
+ int copySize = ( oldSize < xWantedSize ) ? oldSize : xWantedSize;
|
|
+ memcpy( newArea, pv, copySize );
|
|
+
|
|
+ vTaskSuspendAll();
|
|
+ {
|
|
+ /* Add this block to the list of free blocks. */
|
|
+ pxLink->xBlockSize &= ~xBlockAllocatedBit;
|
|
+ xFreeBytesRemaining += pxLink->xBlockSize;
|
|
+ prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
|
|
+ }
|
|
+ xTaskResumeAll();
|
|
+ return newArea;
|
|
+ }
|
|
+ }
|
|
+ else if( xWantedSize )
|
|
+ return pvPortMalloc( xWantedSize );
|
|
+ else
|
|
+ return NULL;
|
|
+
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/MemMang/heap_5.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang/heap_5.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/MemMang/heap_5.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang/heap_5.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -114,6 +114,7 @@
|
|
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
+#include "platform_opts.h"
|
|
|
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
|
|
|
@@ -154,6 +155,12 @@
|
|
fragmentation. */
|
|
static size_t xFreeBytesRemaining = 0;
|
|
static size_t xMinimumEverFreeBytesRemaining = 0;
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+#define SRAM_START_ADDRESS 0x10000000
|
|
+#define SDRAM_START_ADDRESS 0x30000000
|
|
+static size_t xSRAMFreeBytesRemaining = 0;
|
|
+static size_t xSDRAMFreeBytesRemaining = 0;
|
|
+#endif
|
|
|
|
/* Gets set to the top bit of an size_t type. When this bit in the xBlockSize
|
|
member of an BlockLink_t structure is set then the block belongs to the
|
|
@@ -161,13 +168,83 @@
|
|
space. */
|
|
static size_t xBlockAllocatedBit = 0;
|
|
|
|
+/* Realtek test code start */
|
|
+//TODO: remove section when combine BD and BF
|
|
+#if ((defined CONFIG_PLATFORM_8195A) || (defined CONFIG_PLATFORM_8711B))
|
|
+#include "section_config.h"
|
|
+SRAM_BF_DATA_SECTION
|
|
+#endif
|
|
+static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];
|
|
+
|
|
+#if (defined CONFIG_PLATFORM_8195A)
|
|
+HeapRegion_t xHeapRegions[] =
|
|
+{
|
|
+ { (uint8_t*)0x10002300, 0x3D00 }, // Image1 recycle heap
|
|
+ { ucHeap, sizeof(ucHeap) }, // Defines a block from ucHeap
|
|
+#if 0
|
|
+ { (uint8_t*)0x301b5000, 300*1024 }, // SDRAM heap
|
|
+#endif
|
|
+ { NULL, 0 } // Terminates the array.
|
|
+};
|
|
+#elif (defined CONFIG_PLATFORM_8711B)
|
|
+#include "rtl8710b_boot.h"
|
|
+extern BOOT_EXPORT_SYMB_TABLE boot_export_symbol;
|
|
+HeapRegion_t xHeapRegions[] =
|
|
+{
|
|
+ { 0, 0}, // Image1 reserved ,length will be corrected in pvPortMalloc()
|
|
+ { ucHeap, sizeof(ucHeap) }, // Defines a block from ucHeap
|
|
+ { 0, 0}, // RDP reserved, will be corrected in pvPortMalloc()
|
|
+ { NULL, 0 } // Terminates the array.
|
|
+};
|
|
+#else
|
|
+#error NOT SUPPORT CHIP
|
|
+#endif
|
|
+/* Realtek test code end */
|
|
+
|
|
/*-----------------------------------------------------------*/
|
|
+#if 1
|
|
+/*
|
|
+ Dump xBlock list
|
|
+*/
|
|
+void dump_mem_block_list()
|
|
+{
|
|
+ BlockLink_t *pxBlock = &xStart;
|
|
+ int count = 0;
|
|
+
|
|
+ printf("\n===============================>Memory List:\n");
|
|
+ while(pxBlock->pxNextFreeBlock != NULL)
|
|
+ {
|
|
+ printf("[%d]=0x%p, %d\n", count++, pxBlock, pxBlock->xBlockSize);
|
|
+ pxBlock = pxBlock->pxNextFreeBlock;
|
|
+ }
|
|
+}
|
|
+#endif
|
|
|
|
void *pvPortMalloc( size_t xWantedSize )
|
|
{
|
|
BlockLink_t *pxBlock, *pxPreviousBlock, *pxNewBlockLink;
|
|
void *pvReturn = NULL;
|
|
|
|
+ /* Realtek test code start */
|
|
+ if(pxEnd == NULL)
|
|
+ {
|
|
+#if (defined CONFIG_PLATFORM_8711B)
|
|
+ xHeapRegions[ 0 ].xSizeInBytes = (uint32_t)((uint8_t*)0x10005000 - (uint8_t*)boot_export_symbol.boot_ram_end);
|
|
+ xHeapRegions[ 0 ].pucStartAddress = (uint8_t*)boot_export_symbol.boot_ram_end;
|
|
+
|
|
+ if(!IsRDPenabled()){
|
|
+ xHeapRegions[ 2 ].xSizeInBytes = 0x1000;
|
|
+ xHeapRegions[ 2 ].pucStartAddress = (uint8_t*)0x1003f000;
|
|
+ }else{
|
|
+ xHeapRegions[ 2 ].xSizeInBytes = 0;
|
|
+ xHeapRegions[ 2 ].pucStartAddress = NULL;
|
|
+ }
|
|
+
|
|
+#endif
|
|
+ vPortDefineHeapRegions( xHeapRegions );
|
|
+ }
|
|
+ /* Realtek test code end */
|
|
+
|
|
/* The heap must be initialised before the first call to
|
|
prvPortMalloc(). */
|
|
configASSERT( pxEnd );
|
|
@@ -182,7 +259,8 @@
|
|
{
|
|
/* The wanted size is increased so it can contain a BlockLink_t
|
|
structure in addition to the requested amount of bytes. */
|
|
- if( xWantedSize > 0 )
|
|
+ if( ( xWantedSize > 0 ) &&
|
|
+ ( ( xWantedSize + uxHeapStructSize ) > xWantedSize ) ) /* Overflow check */
|
|
{
|
|
xWantedSize += uxHeapStructSize;
|
|
|
|
@@ -190,8 +268,16 @@
|
|
of bytes. */
|
|
if( ( xWantedSize & portBYTE_ALIGNMENT_MASK ) != 0x00 )
|
|
{
|
|
- /* Byte alignment required. */
|
|
- xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
|
|
+ /* Byte alignment required. Check for overflow */
|
|
+ if( ( xWantedSize + ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ) ) >
|
|
+ xWantedSize )
|
|
+ {
|
|
+ xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) );
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ xWantedSize = 0;
|
|
+ }
|
|
}
|
|
else
|
|
{
|
|
@@ -200,13 +286,13 @@
|
|
}
|
|
else
|
|
{
|
|
- mtCOVERAGE_TEST_MARKER();
|
|
+ xWantedSize = 0;
|
|
}
|
|
|
|
if( ( xWantedSize > 0 ) && ( xWantedSize <= xFreeBytesRemaining ) )
|
|
{
|
|
/* Traverse the list from the start (lowest address) block until
|
|
- one of adequate size is found. */
|
|
+ one of adequate size is found. */
|
|
pxPreviousBlock = &xStart;
|
|
pxBlock = xStart.pxNextFreeBlock;
|
|
while( ( pxBlock->xBlockSize < xWantedSize ) && ( pxBlock->pxNextFreeBlock != NULL ) )
|
|
@@ -216,7 +302,7 @@
|
|
}
|
|
|
|
/* If the end marker was reached then a block of adequate size
|
|
- was not found. */
|
|
+ was not found. */
|
|
if( pxBlock != pxEnd )
|
|
{
|
|
/* Return the memory space pointed to - jumping over the
|
|
@@ -251,7 +337,12 @@
|
|
}
|
|
|
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
|
-
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+ if(((uint32_t) pxBlock >= SRAM_START_ADDRESS) && ((uint32_t) pxBlock < SDRAM_START_ADDRESS))
|
|
+ xSRAMFreeBytesRemaining -= pxBlock->xBlockSize;
|
|
+ else if((uint32_t) pxBlock >= SDRAM_START_ADDRESS)
|
|
+ xSDRAMFreeBytesRemaining -= pxBlock->xBlockSize;
|
|
+#endif
|
|
if( xFreeBytesRemaining < xMinimumEverFreeBytesRemaining )
|
|
{
|
|
xMinimumEverFreeBytesRemaining = xFreeBytesRemaining;
|
|
@@ -303,7 +394,7 @@
|
|
}
|
|
/*-----------------------------------------------------------*/
|
|
|
|
-void vPortFree( void *pv )
|
|
+void __vPortFree( void *pv )
|
|
{
|
|
uint8_t *puc = ( uint8_t * ) pv;
|
|
BlockLink_t *pxLink;
|
|
@@ -333,6 +424,12 @@
|
|
{
|
|
/* Add this block to the list of free blocks. */
|
|
xFreeBytesRemaining += pxLink->xBlockSize;
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+ if(((uint32_t) pxLink >= SRAM_START_ADDRESS) && ((uint32_t) pxLink < SDRAM_START_ADDRESS))
|
|
+ xSRAMFreeBytesRemaining += pxLink->xBlockSize;
|
|
+ else if((uint32_t) pxLink >= SDRAM_START_ADDRESS)
|
|
+ xSDRAMFreeBytesRemaining += pxLink->xBlockSize;
|
|
+#endif
|
|
traceFREE( pv, pxLink->xBlockSize );
|
|
prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
|
|
}
|
|
@@ -349,12 +446,44 @@
|
|
}
|
|
}
|
|
}
|
|
+
|
|
+/*-----------------------------------------------------------*/
|
|
+/* Add by Alfa 2015/02/04 -----------------------------------*/
|
|
+static void (*ext_free)( void *p ) = NULL;
|
|
+static uint32_t ext_upper = 0;
|
|
+static uint32_t ext_lower = 0;
|
|
+void vPortSetExtFree( void (*free)( void *p ), uint32_t upper, uint32_t lower )
|
|
+{
|
|
+ ext_free = free;
|
|
+ ext_upper = upper;
|
|
+ ext_lower = lower;
|
|
+}
|
|
+
|
|
+void vPortFree( void *pv )
|
|
+{
|
|
+ if( ((uint32_t)pv >= ext_lower) && ((uint32_t)pv < ext_upper) ){
|
|
+ // use external free function
|
|
+ if( ext_free ) ext_free( pv );
|
|
+ }else
|
|
+ __vPortFree( pv );
|
|
+}
|
|
+
|
|
/*-----------------------------------------------------------*/
|
|
|
|
size_t xPortGetFreeHeapSize( void )
|
|
{
|
|
return xFreeBytesRemaining;
|
|
}
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+size_t xPortGetSRAMFreeHeapSize( void )
|
|
+{
|
|
+ return xSRAMFreeBytesRemaining;
|
|
+}
|
|
+size_t xPortGetSDRAMFreeHeapSize( void )
|
|
+{
|
|
+ return xSDRAMFreeBytesRemaining;
|
|
+}
|
|
+#endif
|
|
/*-----------------------------------------------------------*/
|
|
|
|
size_t xPortGetMinimumEverFreeHeapSize( void )
|
|
@@ -429,6 +558,9 @@
|
|
BlockLink_t *pxFirstFreeBlockInRegion = NULL, *pxPreviousFreeBlock;
|
|
uint8_t *pucAlignedHeap;
|
|
size_t xTotalRegionSize, xTotalHeapSize = 0;
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+size_t xSRAMTotalHeapSize = 0, xSDRAMTotalHeapSize = 0;
|
|
+#endif
|
|
BaseType_t xDefinedRegions = 0;
|
|
uint32_t ulAddress;
|
|
const HeapRegion_t *pxHeapRegion;
|
|
@@ -501,7 +633,12 @@
|
|
}
|
|
|
|
xTotalHeapSize += pxFirstFreeBlockInRegion->xBlockSize;
|
|
-
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+ if(((uint32_t) pxFirstFreeBlockInRegion >= SRAM_START_ADDRESS) && ((uint32_t) pxFirstFreeBlockInRegion < SDRAM_START_ADDRESS))
|
|
+ xSRAMTotalHeapSize += pxFirstFreeBlockInRegion->xBlockSize;
|
|
+ else if((uint32_t) pxFirstFreeBlockInRegion >= SDRAM_START_ADDRESS)
|
|
+ xSDRAMTotalHeapSize += pxFirstFreeBlockInRegion->xBlockSize;
|
|
+#endif
|
|
/* Move onto the next HeapRegion_t structure. */
|
|
xDefinedRegions++;
|
|
pxHeapRegion = &( pxHeapRegions[ xDefinedRegions ] );
|
|
@@ -509,7 +646,10 @@
|
|
|
|
xMinimumEverFreeBytesRemaining = xTotalHeapSize;
|
|
xFreeBytesRemaining = xTotalHeapSize;
|
|
-
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+ xSRAMFreeBytesRemaining = xSRAMTotalHeapSize;
|
|
+ xSDRAMFreeBytesRemaining = xSDRAMTotalHeapSize;
|
|
+#endif
|
|
/* Check something was actually defined before it is accessed. */
|
|
configASSERT( xTotalHeapSize );
|
|
|
|
@@ -517,3 +657,61 @@
|
|
xBlockAllocatedBit = ( ( size_t ) 1 ) << ( ( sizeof( size_t ) * heapBITS_PER_BYTE ) - 1 );
|
|
}
|
|
|
|
+void* pvPortReAlloc( void *pv, size_t xWantedSize )
|
|
+{
|
|
+ BlockLink_t *pxLink;
|
|
+
|
|
+ if( ((uint32_t)pv >= ext_lower) && ((uint32_t)pv < ext_upper) ){
|
|
+ if( ext_free ) ext_free( pv );
|
|
+ pv = NULL;
|
|
+ }
|
|
+
|
|
+ unsigned char *puc = ( unsigned char * ) pv;
|
|
+
|
|
+ if( pv )
|
|
+ {
|
|
+ if( !xWantedSize )
|
|
+ {
|
|
+ vPortFree( pv );
|
|
+ return NULL;
|
|
+ }
|
|
+
|
|
+ void *newArea = pvPortMalloc( xWantedSize );
|
|
+ if( newArea )
|
|
+ {
|
|
+ /* The memory being freed will have an xBlockLink structure immediately
|
|
+ before it. */
|
|
+ puc -= uxHeapStructSize;
|
|
+
|
|
+ /* This casting is to keep the compiler from issuing warnings. */
|
|
+ pxLink = ( void * ) puc;
|
|
+
|
|
+ int oldSize = (pxLink->xBlockSize & ~xBlockAllocatedBit) - uxHeapStructSize;
|
|
+ int copySize = ( oldSize < xWantedSize ) ? oldSize : xWantedSize;
|
|
+ memcpy( newArea, pv, copySize );
|
|
+
|
|
+ vTaskSuspendAll();
|
|
+ {
|
|
+ /* Add this block to the list of free blocks. */
|
|
+ pxLink->xBlockSize &= ~xBlockAllocatedBit;
|
|
+ xFreeBytesRemaining += pxLink->xBlockSize;
|
|
+#if defined CONFIG_PLATFORM_8195A
|
|
+ if(((uint32_t) pxLink >= SRAM_START_ADDRESS) && ((uint32_t) pxLink < SDRAM_START_ADDRESS))
|
|
+ xSRAMFreeBytesRemaining += pxLink->xBlockSize;
|
|
+ else if((uint32_t) pxLink >= SDRAM_START_ADDRESS)
|
|
+ xSDRAMFreeBytesRemaining += pxLink->xBlockSize;
|
|
+#endif
|
|
+ prvInsertBlockIntoFreeList( ( ( BlockLink_t * ) pxLink ) );
|
|
+ }
|
|
+ xTaskResumeAll();
|
|
+ return newArea;
|
|
+ }
|
|
+ }
|
|
+ else if( xWantedSize )
|
|
+ return pvPortMalloc( xWantedSize );
|
|
+ else
|
|
+ return NULL;
|
|
+
|
|
+ return NULL;
|
|
+}
|
|
+
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang: heap_5.o
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/MemMang: Makefile
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: MPLAB
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: MSVC-MingW
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: oWatcom
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Paradigm
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: readme.txt
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Renesas
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Rowley
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS: ARM7_LPC21xx
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS: ARM_CA9
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS: ARM_CM0
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/RVDS/ARM_CM4F/port.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS/ARM_CM4F/port.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/RVDS/ARM_CM4F/port.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -791,4 +791,20 @@
|
|
|
|
#endif /* configASSERT_DEFINED */
|
|
|
|
+/*-----------------------------------------------------------*/
|
|
+void vApplicationIdleHook( void )
|
|
+{
|
|
+ /* Use the idle task to place the CPU into a low power mode. Greater power
|
|
+ saving could be achieved by not including any demo tasks that never block. */
|
|
+}
|
|
|
|
+void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName )
|
|
+{
|
|
+ /* This function will be called if a task overflows its stack, if
|
|
+ configCHECK_FOR_STACK_OVERFLOW != 0. It might be that the function
|
|
+ parameters have been corrupted, depending on the severity of the stack
|
|
+ overflow. When this is the case pxCurrentTCB can be inspected in the
|
|
+ debugger to find the offending task. */
|
|
+ printf("\n\r[%s] STACK OVERFLOW - TaskName(%s)\n\r", __FUNCTION__, pcTaskName);
|
|
+ for( ;; );
|
|
+}
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/RVDS/ARM_CM4F/portmacro.h
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable/RVDS/ARM_CM4F/portmacro.h 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/portable/RVDS/ARM_CM4F/portmacro.h 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -148,7 +148,7 @@
|
|
#if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
|
|
|
|
/* Check the configuration. */
|
|
- #if( configMAX_PRIORITIES > 32 )
|
|
+ #if 0//( configMAX_PRIORITIES > 32 )
|
|
#error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
|
|
#endif
|
|
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: SDCC
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Softune
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: Tasking
|
|
Only in ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/portable: WizC
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/queue.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/queue.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/queue.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/queue.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -65,6 +65,7 @@
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
+#include <platform/platform_stdlib.h>
|
|
|
|
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
|
all the API functions to use the MPU wrappers. That should only be done when
|
|
@@ -325,6 +326,9 @@
|
|
longer than asked for to make wrap checking easier/faster. */
|
|
xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ) + ( size_t ) 1; /*lint !e961 MISRA exception as the casts are only redundant for some ports. */
|
|
|
|
+ /* Check for multiplication overflow. */
|
|
+ configASSERT( ( uxItemSize == 0 ) || ( uxQueueLength == ( ( xQueueSizeInBytes - 1 ) / uxItemSize ) ) );
|
|
+
|
|
pxNewQueue->pcHead = ( int8_t * ) pvPortMalloc( xQueueSizeInBytes );
|
|
if( pxNewQueue->pcHead != NULL )
|
|
{
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: queue.o
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/tasks.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/tasks.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/tasks.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/tasks.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -66,6 +66,7 @@
|
|
/* Standard includes. */
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
+#include <platform/platform_stdlib.h>
|
|
|
|
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
|
all the API functions to use the MPU wrappers. That should only be done when
|
|
@@ -104,6 +105,20 @@
|
|
*/
|
|
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE
|
|
|
|
+#define RTL_PLACE_IDLE_STACK_IN_SRAM
|
|
+#ifdef RTL_PLACE_IDLE_STACK_IN_SRAM
|
|
+
|
|
+ /* 20151104 User may place heap in SDRAM and cause tickless hang because SDRAM is susupend and idle stack is in SDRAM.
|
|
+ * Fix it by place idle stack in SRAM.
|
|
+ */
|
|
+#if ((defined CONFIG_PLATFORM_8195A) || (defined CONFIG_PLATFORM_8711B))
|
|
+ #include "section_config.h"
|
|
+ SRAM_BF_DATA_SECTION
|
|
+#endif
|
|
+ static unsigned char ucIdleTaskHeap[ tskIDLE_STACK_SIZE * sizeof( StackType_t ) ];
|
|
+
|
|
+#endif
|
|
+
|
|
#if( configUSE_PREEMPTION == 0 )
|
|
/* If the cooperative scheduler is being used then a yield should not be
|
|
performed just because a higher priority task has been woken. */
|
|
@@ -133,7 +148,9 @@
|
|
|
|
#if ( portSTACK_GROWTH > 0 )
|
|
StackType_t *pxEndOfStack; /*< Points to the end of the stack on architectures where the stack grows up from low memory. */
|
|
- #endif
|
|
+ #else
|
|
+ UBaseType_t uxSizeOfStack; /*< Support For CmBacktrace >*/
|
|
+ #endif /* ( portSTACK_GROWTH > 0 )*/
|
|
|
|
#if ( portCRITICAL_NESTING_IN_TCB == 1 )
|
|
UBaseType_t uxCriticalNesting; /*< Holds the critical section nesting depth for ports that do not maintain their own count in the port layer. */
|
|
@@ -155,6 +172,8 @@
|
|
|
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
uint32_t ulRunTimeCounter; /*< Stores the amount of time the task has spent in the Running state. */
|
|
+ uint32_t ulStartRunTimeCounterOfPeroid; /*< Stores the amount of time the task has spent in the Running state during a peroid start. */
|
|
+ uint32_t ulEndRunTimeCounterOfPeroid; /*< Stores the amount of time the task has spent in the Running state when a peroid end */
|
|
#endif
|
|
|
|
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
|
@@ -239,7 +258,7 @@
|
|
|
|
PRIVILEGED_DATA static uint32_t ulTaskSwitchedInTime = 0UL; /*< Holds the value of a timer/counter the last time a task was switched in. */
|
|
PRIVILEGED_DATA static uint32_t ulTotalRunTime = 0UL; /*< Holds the total amount of execution time as defined by the run time counter clock. */
|
|
-
|
|
+ PRIVILEGED_DATA static uint32_t ulDeltaTotalRunTime = 0UL; /*< Holds the delta total amount of execution time*/
|
|
#endif
|
|
|
|
/*lint +e956 */
|
|
@@ -554,6 +573,8 @@
|
|
|
|
/* Check the alignment of the calculated top of stack is correct. */
|
|
configASSERT( ( ( ( portPOINTER_SIZE_TYPE ) pxTopOfStack & ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) == 0UL ) );
|
|
+ pxNewTCB->uxSizeOfStack = usStackDepth; /*< Support For CmBacktrace >*/
|
|
+
|
|
}
|
|
#else /* portSTACK_GROWTH */
|
|
{
|
|
@@ -1459,14 +1480,24 @@
|
|
/* Add the idle task at the lowest priority. */
|
|
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
|
|
{
|
|
+#ifdef RTL_PLACE_IDLE_STACK_IN_SRAM
|
|
+ // it's same function call as original FreeRTOS source except that it use stack in SRAM
|
|
+ xReturn = xTaskGenericCreate( prvIdleTask, "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle, (void *)&ucIdleTaskHeap, NULL);
|
|
+#else
|
|
/* Create the idle task, storing its handle in xIdleTaskHandle so it can
|
|
be returned by the xTaskGetIdleTaskHandle() function. */
|
|
xReturn = xTaskCreate( prvIdleTask, "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), &xIdleTaskHandle ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
|
|
+#endif
|
|
}
|
|
#else
|
|
{
|
|
+#ifdef RTL_PLACE_IDLE_STACK_IN_SRAM
|
|
+ // it's same function call as original FreeRTOS source except that it use stack in SRAM
|
|
+ xReturn = xTaskGenericCreate( prvIdleTask, "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), NULL, (void *)&ucIdleTaskHeap, NULL );
|
|
+#else
|
|
/* Create the idle task without storing its handle. */
|
|
xReturn = xTaskCreate( prvIdleTask, "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), NULL ); /*lint !e961 MISRA exception, justified as it is not a redundant explicit cast to all supported compilers. */
|
|
+#endif
|
|
}
|
|
#endif /* INCLUDE_xTaskGetIdleTaskHandle */
|
|
|
|
@@ -1750,6 +1781,9 @@
|
|
vTaskSuspendAll();
|
|
{
|
|
/* Is there a space in the array for each task in the system? */
|
|
+#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
+ ulDeltaTotalRunTime = 0;
|
|
+#endif
|
|
if( uxArraySize >= uxCurrentNumberOfTasks )
|
|
{
|
|
/* Fill in an TaskStatus_t structure with information on each
|
|
@@ -1847,6 +1881,77 @@
|
|
#endif /* configUSE_TICKLESS_IDLE */
|
|
/*----------------------------------------------------------*/
|
|
|
|
+#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( configUSE_STATS_FORMATTING_FUNCTIONS == 1 ) )
|
|
+ static void prvGenerateRunTimeOfPeroid(xList *pxList, portTickType tickTmp)
|
|
+ {
|
|
+ volatile tskTCB *pxNextTCB, *pxFirstTCB;
|
|
+
|
|
+ /* Write the run time stats of all the TCB's in pxList into the buffer. */
|
|
+ listGET_OWNER_OF_NEXT_ENTRY( pxFirstTCB, pxList );
|
|
+ do
|
|
+ {
|
|
+ /* Get next TCB in from the list. */
|
|
+ listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );
|
|
+
|
|
+ /* Record start&end run time counter. */
|
|
+ if (tickTmp%(2*portCONFIGURE_STATS_PEROID_VALUE))
|
|
+ pxNextTCB->ulStartRunTimeCounterOfPeroid = pxNextTCB->ulRunTimeCounter;
|
|
+ else
|
|
+ pxNextTCB->ulEndRunTimeCounterOfPeroid = pxNextTCB->ulRunTimeCounter;
|
|
+
|
|
+ } while( pxNextTCB != pxFirstTCB );
|
|
+ }
|
|
+
|
|
+ static void prvGetRunTimeStatsOfPeroidForTasksInList(portTickType tickTmp)
|
|
+ {
|
|
+ unsigned portBASE_TYPE uxQueue;
|
|
+
|
|
+ if (tickTmp%portCONFIGURE_STATS_PEROID_VALUE){
|
|
+ return;//only portCONFIGURE_STATS_PEROID_VALUE
|
|
+ }
|
|
+
|
|
+ uxQueue = configMAX_PRIORITIES;
|
|
+
|
|
+ do
|
|
+ {
|
|
+ uxQueue--;
|
|
+
|
|
+ if( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxQueue ] ) ) == pdFALSE )
|
|
+ {
|
|
+ prvGenerateRunTimeOfPeroid(( xList * ) &( pxReadyTasksLists[ uxQueue ] ), tickTmp );
|
|
+ }
|
|
+ }while( uxQueue > ( UBaseType_t ) tskIDLE_PRIORITY );
|
|
+
|
|
+ if( listLIST_IS_EMPTY( pxDelayedTaskList ) == pdFALSE )
|
|
+ {
|
|
+ prvGenerateRunTimeOfPeroid(( xList * ) pxDelayedTaskList, tickTmp );
|
|
+ }
|
|
+
|
|
+ if( listLIST_IS_EMPTY( pxOverflowDelayedTaskList ) == pdFALSE )
|
|
+ {
|
|
+ prvGenerateRunTimeOfPeroid(( xList * ) pxOverflowDelayedTaskList, tickTmp );
|
|
+ }
|
|
+
|
|
+#if ( INCLUDE_vTaskDelete == 1 )
|
|
+ {
|
|
+ if( listLIST_IS_EMPTY( &xTasksWaitingTermination ) == pdFALSE )
|
|
+ {
|
|
+ prvGenerateRunTimeOfPeroid(&xTasksWaitingTermination, tickTmp );
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+
|
|
+#if ( INCLUDE_vTaskSuspend == 1 )
|
|
+ {
|
|
+ if( listLIST_IS_EMPTY( &xSuspendedTaskList ) == pdFALSE )
|
|
+ {
|
|
+ prvGenerateRunTimeOfPeroid(&xSuspendedTaskList, tickTmp );
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+ }
|
|
+#endif
|
|
+
|
|
BaseType_t xTaskIncrementTick( void )
|
|
{
|
|
TCB_t * pxTCB;
|
|
@@ -2003,6 +2108,9 @@
|
|
}
|
|
#endif
|
|
}
|
|
+ #if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
+ prvGetRunTimeStatsOfPeroidForTasksInList(xTickCount);
|
|
+ #endif
|
|
|
|
#if ( configUSE_PREEMPTION == 1 )
|
|
{
|
|
@@ -2770,6 +2878,8 @@
|
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
{
|
|
pxTCB->ulRunTimeCounter = 0UL;
|
|
+ pxTCB->ulStartRunTimeCounterOfPeroid = 0UL;
|
|
+ pxTCB->ulEndRunTimeCounterOfPeroid = 0UL;
|
|
}
|
|
#endif /* configGENERATE_RUN_TIME_STATS */
|
|
|
|
@@ -3001,6 +3111,11 @@
|
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
|
{
|
|
pxTaskStatusArray[ uxTask ].ulRunTimeCounter = pxNextTCB->ulRunTimeCounter;
|
|
+ if (pxNextTCB->ulEndRunTimeCounterOfPeroid > pxNextTCB->ulStartRunTimeCounterOfPeroid)
|
|
+ pxTaskStatusArray[ uxTask ].ulDelataRunTimeCounterOfPeroid = pxNextTCB->ulEndRunTimeCounterOfPeroid - pxNextTCB->ulStartRunTimeCounterOfPeroid;
|
|
+ else
|
|
+ pxTaskStatusArray[ uxTask ].ulDelataRunTimeCounterOfPeroid = pxNextTCB->ulStartRunTimeCounterOfPeroid - pxNextTCB->ulEndRunTimeCounterOfPeroid;
|
|
+ ulDeltaTotalRunTime += pxTaskStatusArray[ uxTask ].ulDelataRunTimeCounterOfPeroid;
|
|
}
|
|
#else
|
|
{
|
|
@@ -3460,7 +3575,7 @@
|
|
{
|
|
TaskStatus_t *pxTaskStatusArray;
|
|
volatile UBaseType_t uxArraySize, x;
|
|
- uint32_t ulTotalTime, ulStatsAsPercentage;
|
|
+ uint32_t ulTotalTime, ulStatsAsPercentage, ulDeltaRunTimeCounter;
|
|
|
|
#if( configUSE_TRACE_FACILITY != 1 )
|
|
{
|
|
@@ -3507,6 +3622,8 @@
|
|
{
|
|
/* Generate the (binary) data. */
|
|
uxArraySize = uxTaskGetSystemState( pxTaskStatusArray, uxArraySize, &ulTotalTime );
|
|
+ printf("\n\rCPU total run time is %u", ulTotalTime);
|
|
+ printf("\n\rTaskName\tDeltaRunTime\tpercentage\r\n");
|
|
|
|
/* For percentage calculations. */
|
|
ulTotalTime /= 100UL;
|
|
@@ -3520,19 +3637,36 @@
|
|
/* What percentage of the total run time has the task used?
|
|
This will always be rounded down to the nearest integer.
|
|
ulTotalRunTimeDiv100 has already been divided by 100. */
|
|
+#if 0
|
|
ulStatsAsPercentage = pxTaskStatusArray[ x ].ulRunTimeCounter / ulTotalTime;
|
|
+#else
|
|
+ ulStatsAsPercentage = (100*pxTaskStatusArray[ x ].ulDelataRunTimeCounterOfPeroid) / ulDeltaTotalRunTime;
|
|
+ /* just make run time counter looks like more precise*/
|
|
+ if (100*(100*pxTaskStatusArray[ x ].ulDelataRunTimeCounterOfPeroid) % ulDeltaTotalRunTime >=50)
|
|
+ ulDeltaRunTimeCounter = portCONFIGURE_STATS_PEROID_VALUE*(ulStatsAsPercentage+1)/100;
|
|
+ else
|
|
+ ulDeltaRunTimeCounter = portCONFIGURE_STATS_PEROID_VALUE*ulStatsAsPercentage/100;
|
|
+#endif
|
|
|
|
if( ulStatsAsPercentage > 0UL )
|
|
{
|
|
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
|
|
{
|
|
+#if 0
|
|
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter, ulStatsAsPercentage );
|
|
+#else
|
|
+ sprintf( pcWriteBuffer, "%s\t\t%lu\t\t%lu%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ulDeltaRunTimeCounter, ulStatsAsPercentage );
|
|
+#endif
|
|
}
|
|
#else
|
|
{
|
|
/* sizeof( int ) == sizeof( long ) so a smaller
|
|
printf() library can be used. */
|
|
+#if 0
|
|
sprintf( pcWriteBuffer, "%s\t\t%u\t\t%u%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
|
|
+#else
|
|
+ sprintf( pcWriteBuffer, "%s\t\t%u\t\t%u%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) ulDeltaRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
|
|
+#endif
|
|
}
|
|
#endif
|
|
}
|
|
@@ -3542,13 +3676,21 @@
|
|
consumed less than 1% of the total run time. */
|
|
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
|
|
{
|
|
+#if 0
|
|
sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, pxTaskStatusArray[ x ].ulRunTimeCounter );
|
|
+#else
|
|
+ sprintf( pcWriteBuffer, "%s\t\t%lu\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ulDeltaRunTimeCounter );
|
|
+#endif
|
|
}
|
|
#else
|
|
{
|
|
/* sizeof( int ) == sizeof( long ) so a smaller
|
|
printf() library can be used. */
|
|
+#if 0
|
|
sprintf( pcWriteBuffer, "%s\t\t%u\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) pxTaskStatusArray[ x ].ulRunTimeCounter );
|
|
+#else
|
|
+ sprintf( pcWriteBuffer, "%s\t\t%u\t\t<1%%\r\n", pxTaskStatusArray[ x ].pcTaskName, ( unsigned int ) ulDeltaRunTimeCounter );
|
|
+#endif
|
|
}
|
|
#endif
|
|
}
|
|
@@ -3604,6 +3746,41 @@
|
|
#endif /* configUSE_MUTEXES */
|
|
|
|
/*-----------------------------------------------------------*/
|
|
+void * vTaskGetCurrentTCB( void )
|
|
+{
|
|
+ return (void*)pxCurrentTCB;
|
|
+}
|
|
+
|
|
+/*-----------------------------------------------------------*/
|
|
+/*< Support For CmBacktrace >*/
|
|
+uint32_t * vTaskStackAddr()
|
|
+{
|
|
+ return pxCurrentTCB->pxStack;
|
|
+}
|
|
+
|
|
+volatile uint32_t * vTaskStackTOPAddr()
|
|
+{
|
|
+ return pxCurrentTCB->pxTopOfStack;
|
|
+}
|
|
+
|
|
+
|
|
+uint32_t vTaskStackSize()
|
|
+{
|
|
+ #if ( portSTACK_GROWTH > 0 )
|
|
+
|
|
+ return (pxNewTCB->pxEndOfStack - pxNewTCB->pxStack + 1);
|
|
+
|
|
+ #else /* ( portSTACK_GROWTH > 0 )*/
|
|
+
|
|
+ return pxCurrentTCB->uxSizeOfStack;
|
|
+
|
|
+ #endif /* ( portSTACK_GROWTH > 0 )*/
|
|
+}
|
|
+
|
|
+char * vTaskName()
|
|
+{
|
|
+ return pxCurrentTCB->pcTaskName;
|
|
+}
|
|
|
|
#ifdef FREERTOS_MODULE_TEST
|
|
#include "tasks_test_access_functions.h"
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: tasks.o
|
|
diff -ur --strip-trailing-cr ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/timers.c lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/timers.c
|
|
--- ../FreeRTOS-Kernel-8.1.2/FreeRTOS/Source/timers.c 2014-09-03 15:10:11.000000000 +0700
|
|
+++ lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/timers.c 2024-11-27 13:57:10.361241279 +0600
|
|
@@ -164,6 +164,12 @@
|
|
/* A queue that is used to send commands to the timer service task. */
|
|
PRIVILEGED_DATA static QueueHandle_t xTimerQueue = NULL;
|
|
|
|
+// Added by Realtek to prevent timer thread blocked
|
|
+#ifdef INCLUDE_xTimerGetTimerDaemonTaskHandle
|
|
+#undef INCLUDE_xTimerGetTimerDaemonTaskHandle
|
|
+#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
|
|
+#endif
|
|
+
|
|
#if ( INCLUDE_xTimerGetTimerDaemonTaskHandle == 1 )
|
|
|
|
PRIVILEGED_DATA static TaskHandle_t xTimerTaskHandle = NULL;
|
|
@@ -249,12 +255,12 @@
|
|
{
|
|
/* Create the timer task, storing its handle in xTimerTaskHandle so
|
|
it can be returned by the xTimerGetTimerDaemonTaskHandle() function. */
|
|
- xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( uint16_t ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, &xTimerTaskHandle );
|
|
+ xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( uint16_t ) configTIMER_TASK_STACK_DEPTH, NULL, (( ( UBaseType_t ) configTIMER_TASK_PRIORITY + PRIORITY_OFFSET) | portPRIVILEGE_BIT), &xTimerTaskHandle );
|
|
}
|
|
#else
|
|
{
|
|
/* Create the timer task without storing its handle. */
|
|
- xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( uint16_t ) configTIMER_TASK_STACK_DEPTH, NULL, ( ( UBaseType_t ) configTIMER_TASK_PRIORITY ) | portPRIVILEGE_BIT, NULL);
|
|
+ xReturn = xTaskCreate( prvTimerTask, "Tmr Svc", ( uint16_t ) configTIMER_TASK_STACK_DEPTH, NULL, (( ( UBaseType_t ) configTIMER_TASK_PRIORITY + PRIORITY_OFFSET) | portPRIVILEGE_BIT ), NULL);
|
|
}
|
|
#endif
|
|
}
|
|
@@ -308,12 +314,21 @@
|
|
return ( TimerHandle_t ) pxNewTimer;
|
|
}
|
|
/*-----------------------------------------------------------*/
|
|
+extern void * vTaskGetCurrentTCB( void );
|
|
+static void prvProcessCommands( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue );
|
|
|
|
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait )
|
|
{
|
|
BaseType_t xReturn = pdFAIL;
|
|
DaemonTaskMessage_t xMessage;
|
|
|
|
+ // Added by Realtek to prevent timer thread blocked
|
|
+ if( ( vTaskGetCurrentTCB() == ( void * ) xTimerTaskHandle ) && ( ( xCommandID == tmrCOMMAND_STOP ) || ( xCommandID == tmrCOMMAND_CHANGE_PERIOD ) ) )
|
|
+ {
|
|
+ prvProcessCommands( xTimer, xCommandID, xOptionalValue );
|
|
+ return pdPASS;
|
|
+ }
|
|
+
|
|
/* Send a message to the timer service task to perform a particular action
|
|
on a particular timer definition. */
|
|
if( xTimerQueue != NULL )
|
|
@@ -702,6 +717,42 @@
|
|
}
|
|
}
|
|
}
|
|
+
|
|
+// Added by Realtek to prevent timer thread blocked
|
|
+static void prvProcessCommands( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue )
|
|
+{
|
|
+Timer_t *pxTimer = ( Timer_t * ) xTimer;
|
|
+TickType_t xTimeNow = xTaskGetTickCount();;
|
|
+
|
|
+ if( listIS_CONTAINED_WITHIN( NULL, &( pxTimer->xTimerListItem ) ) == pdFALSE )
|
|
+ {
|
|
+ /* The timer is in a list, remove it. */
|
|
+ ( void ) uxListRemove( &( pxTimer->xTimerListItem ) );
|
|
+ }
|
|
+
|
|
+ switch( xCommandID )
|
|
+ {
|
|
+ case tmrCOMMAND_STOP :
|
|
+ /* The timer has already been removed from the active list.
|
|
+ There is nothing to do here. */
|
|
+ break;
|
|
+
|
|
+ case tmrCOMMAND_CHANGE_PERIOD :
|
|
+ pxTimer->xTimerPeriodInTicks = xOptionalValue;
|
|
+ ( void ) prvInsertTimerInActiveList( pxTimer, ( xTimeNow + pxTimer->xTimerPeriodInTicks ), xTimeNow, xTimeNow );
|
|
+ break;
|
|
+
|
|
+ case tmrCOMMAND_DELETE :
|
|
+ /* The timer has already been removed from the active list,
|
|
+ just free up the memory. */
|
|
+ vPortFree( pxTimer );
|
|
+ break;
|
|
+
|
|
+ default :
|
|
+ /* Don't expect to get here. */
|
|
+ break;
|
|
+ }
|
|
+}
|
|
/*-----------------------------------------------------------*/
|
|
|
|
static void prvSwitchTimerLists( void )
|
|
Only in lib/amb1_sdk/os/freertos/freertos_v8.1.2/Source/: timers.o
|