mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-02 10:24:11 +01:00
Upgrade FreeRTOS to the latest version (6.1.1) which allows compiling with -Os
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2562 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
parent
c55d40bdbc
commit
607cdcac21
13
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/croutine.c
Normal file → Executable file
13
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/croutine.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -55,15 +55,6 @@
|
|||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "croutine.h"
|
#include "croutine.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* @file croutine.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some kernel aware debuggers require data to be viewed to be global, rather
|
* Some kernel aware debuggers require data to be viewed to be global, rather
|
||||||
* than file scope.
|
* than file scope.
|
||||||
|
24
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/FreeRTOS.h
Normal file → Executable file
24
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/FreeRTOS.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -54,14 +54,6 @@
|
|||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#define INC_FREERTOS_H
|
#define INC_FREERTOS_H
|
||||||
|
|
||||||
/**
|
|
||||||
* @file FreeRTOS.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Include the generic headers required for the FreeRTOS port being used.
|
* Include the generic headers required for the FreeRTOS port being used.
|
||||||
@ -296,6 +288,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
|||||||
#define traceTAKE_MUTEX_RECURSIVE( pxMutex )
|
#define traceTAKE_MUTEX_RECURSIVE( pxMutex )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef traceTAKE_MUTEX_RECURSIVE_FAILED
|
||||||
|
#define traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex )
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef traceCREATE_COUNTING_SEMAPHORE
|
#ifndef traceCREATE_COUNTING_SEMAPHORE
|
||||||
#define traceCREATE_COUNTING_SEMAPHORE()
|
#define traceCREATE_COUNTING_SEMAPHORE()
|
||||||
#endif
|
#endif
|
||||||
@ -349,7 +345,7 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef traceTASK_CREATE_FAILED
|
#ifndef traceTASK_CREATE_FAILED
|
||||||
#define traceTASK_CREATE_FAILED( pxNewTCB )
|
#define traceTASK_CREATE_FAILED()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef traceTASK_DELETE
|
#ifndef traceTASK_DELETE
|
||||||
@ -395,7 +391,9 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
|||||||
#endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
|
#endif /* portCONFIGURE_TIMER_FOR_RUN_TIME_STATS */
|
||||||
|
|
||||||
#ifndef portGET_RUN_TIME_COUNTER_VALUE
|
#ifndef portGET_RUN_TIME_COUNTER_VALUE
|
||||||
#error If configGENERATE_RUN_TIME_STATS is defined then portGET_RUN_TIME_COUNTER_VALUE must also be defined. portGET_RUN_TIME_COUNTER_VALUE should evaluate to the counter value of the timer/counter peripheral used as the run time counter time base.
|
#ifndef portALT_GET_RUN_TIME_COUNTER_VALUE
|
||||||
|
#error If configGENERATE_RUN_TIME_STATS is defined then either portGET_RUN_TIME_COUNTER_VALUE or portALT_GET_RUN_TIME_COUNTER_VALUE must also be defined. See the examples provided and the FreeRTOS web site for more information.
|
||||||
|
#endif /* portALT_GET_RUN_TIME_COUNTER_VALUE */
|
||||||
#endif /* portGET_RUN_TIME_COUNTER_VALUE */
|
#endif /* portGET_RUN_TIME_COUNTER_VALUE */
|
||||||
|
|
||||||
#endif /* configGENERATE_RUN_TIME_STATS */
|
#endif /* configGENERATE_RUN_TIME_STATS */
|
||||||
@ -417,7 +415,7 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef pvPortMallocAligned
|
#ifndef pvPortMallocAligned
|
||||||
#define pvPortMallocAligned( xSize, pvBuffer ) pvPortMalloc( xSize ); ( void ) pvBuffer
|
#define pvPortMallocAligned( x, puxStackBuffer ) ( ( puxStackBuffer == NULL ) ? ( pvPortMalloc( x ) ) : ( puxStackBuffer ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef vPortFreeAligned
|
#ifndef vPortFreeAligned
|
||||||
|
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/StackMacros.h
Normal file → Executable file
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/StackMacros.h
Normal file → Executable file
@ -1,14 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file StackMacros.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -19,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -111,7 +102,7 @@
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
#endif /* configCHECK_FOR_STACK_OVERFLOW > 0 */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH > 0 ) )
|
#if( ( configCHECK_FOR_STACK_OVERFLOW > 0 ) && ( portSTACK_GROWTH > 0 ) )
|
||||||
|
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/croutine.h
Normal file → Executable file
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/croutine.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -52,17 +52,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "#include FreeRTOS.h" must appear in source files before "#include croutine.h"
|
#error "include FreeRTOS.h must appear in source files before include croutine.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* @file croutine.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CO_ROUTINE_H
|
#ifndef CO_ROUTINE_H
|
||||||
@ -126,7 +119,7 @@ typedef struct corCoRoutineControlBlock
|
|||||||
// Variables in co-routines must be declared static if they must maintain value across a blocking call.
|
// Variables in co-routines must be declared static if they must maintain value across a blocking call.
|
||||||
// This may not be necessary for const variables.
|
// This may not be necessary for const variables.
|
||||||
static const char cLedToFlash[ 2 ] = { 5, 6 };
|
static const char cLedToFlash[ 2 ] = { 5, 6 };
|
||||||
static const portTickType xTimeToDelay[ 2 ] = { 200, 400 };
|
static const portTickType uxFlashRates[ 2 ] = { 200, 400 };
|
||||||
|
|
||||||
// Must start every co-routine with a call to crSTART();
|
// Must start every co-routine with a call to crSTART();
|
||||||
crSTART( xHandle );
|
crSTART( xHandle );
|
||||||
|
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/list.h
Normal file → Executable file
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/list.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
|
6
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/mpu_wrappers.h
Normal file → Executable file
6
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/mpu_wrappers.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -59,7 +59,7 @@ only for ports that are using the MPU. */
|
|||||||
#ifdef portUSING_MPU_WRAPPERS
|
#ifdef portUSING_MPU_WRAPPERS
|
||||||
|
|
||||||
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
|
/* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
|
||||||
included from queue.c or task.c to prevent it from having an effict within
|
included from queue.c or task.c to prevent it from having an effect within
|
||||||
those files. */
|
those files. */
|
||||||
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||||
|
|
||||||
|
14
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/portable.h
Normal file → Executable file
14
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/portable.h
Normal file → Executable file
@ -1,14 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file portable.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -19,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -67,7 +58,6 @@
|
|||||||
#ifndef PORTABLE_H
|
#ifndef PORTABLE_H
|
||||||
#define PORTABLE_H
|
#define PORTABLE_H
|
||||||
|
|
||||||
|
|
||||||
/* Include the macro file relevant to the port being used. */
|
/* Include the macro file relevant to the port being used. */
|
||||||
|
|
||||||
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
|
#ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
|
||||||
|
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/projdefs.h
Normal file → Executable file
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/projdefs.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
|
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/queue.h
Normal file → Executable file
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/queue.h
Normal file → Executable file
@ -1,14 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file queue.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -19,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -65,6 +56,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef QUEUE_H
|
#ifndef QUEUE_H
|
||||||
#define QUEUE_H
|
#define QUEUE_H
|
||||||
|
|
||||||
|
29
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/semphr.h
Normal file → Executable file
29
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/semphr.h
Normal file → Executable file
@ -1,14 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file tasks.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -19,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -67,8 +58,6 @@
|
|||||||
#ifndef SEMAPHORE_H
|
#ifndef SEMAPHORE_H
|
||||||
#define SEMAPHORE_H
|
#define SEMAPHORE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
|
|
||||||
typedef xQueueHandle xSemaphoreHandle;
|
typedef xQueueHandle xSemaphoreHandle;
|
||||||
@ -126,7 +115,7 @@ typedef xQueueHandle xSemaphoreHandle;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* xSemaphoreTake(
|
* <pre>xSemaphoreTake(
|
||||||
* xSemaphoreHandle xSemaphore,
|
* xSemaphoreHandle xSemaphore,
|
||||||
* portTickType xBlockTime
|
* portTickType xBlockTime
|
||||||
* )</pre>
|
* )</pre>
|
||||||
@ -465,7 +454,7 @@ typedef xQueueHandle xSemaphoreHandle;
|
|||||||
* <pre>
|
* <pre>
|
||||||
xSemaphoreGiveFromISR(
|
xSemaphoreGiveFromISR(
|
||||||
xSemaphoreHandle xSemaphore,
|
xSemaphoreHandle xSemaphore,
|
||||||
portBASE_TYPE *pxHigherPriorityTaskWoken
|
signed portBASE_TYPE *pxHigherPriorityTaskWoken
|
||||||
)</pre>
|
)</pre>
|
||||||
*
|
*
|
||||||
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
|
* <i>Macro</i> to release a semaphore. The semaphore must have previously been
|
||||||
@ -489,8 +478,8 @@ typedef xQueueHandle xSemaphoreHandle;
|
|||||||
*
|
*
|
||||||
* Example usage:
|
* Example usage:
|
||||||
<pre>
|
<pre>
|
||||||
#define LONG_TIME 0xffff
|
\#define LONG_TIME 0xffff
|
||||||
#define TICKS_TO_WAIT 10
|
\#define TICKS_TO_WAIT 10
|
||||||
xSemaphoreHandle xSemaphore = NULL;
|
xSemaphoreHandle xSemaphore = NULL;
|
||||||
|
|
||||||
// Repetitive task.
|
// Repetitive task.
|
||||||
@ -520,7 +509,7 @@ typedef xQueueHandle xSemaphoreHandle;
|
|||||||
void vTimerISR( void * pvParameters )
|
void vTimerISR( void * pvParameters )
|
||||||
{
|
{
|
||||||
static unsigned char ucLocalTickCount = 0;
|
static unsigned char ucLocalTickCount = 0;
|
||||||
static portBASE_TYPE xHigherPriorityTaskWoken;
|
static signed portBASE_TYPE xHigherPriorityTaskWoken;
|
||||||
|
|
||||||
// A timer tick has occurred.
|
// A timer tick has occurred.
|
||||||
|
|
||||||
@ -720,7 +709,3 @@ typedef xQueueHandle xSemaphoreHandle;
|
|||||||
#endif /* SEMAPHORE_H */
|
#endif /* SEMAPHORE_H */
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @}
|
|
||||||
* @}
|
|
||||||
*/
|
|
57
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/task.h
Normal file → Executable file
57
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/include/task.h
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -53,16 +53,9 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "#include FreeRTOS.h" must appear in source files before "#include task.h"
|
#error "include FreeRTOS.h must appear in source files before include task.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef TASK_H
|
#ifndef TASK_H
|
||||||
@ -79,7 +72,7 @@ extern "C" {
|
|||||||
* MACROS AND DEFINITIONS
|
* MACROS AND DEFINITIONS
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
#define tskKERNEL_VERSION_NUMBER "V6.0.0"
|
#define tskKERNEL_VERSION_NUMBER "V6.1.1"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
@ -281,7 +274,7 @@ typedef struct xTASK_PARAMTERS
|
|||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
*<pre>
|
*<pre>
|
||||||
portBASE_TYPE xTaskCreateRestricted( xTaskParameters *pxTaskDefinition, xTaskHandle pxCreatedTask );</pre>
|
portBASE_TYPE xTaskCreateRestricted( xTaskParameters *pxTaskDefinition, xTaskHandle *pxCreatedTask );</pre>
|
||||||
*
|
*
|
||||||
* xTaskCreateRestricted() should only be used in systems that include an MPU
|
* xTaskCreateRestricted() should only be used in systems that include an MPU
|
||||||
* implementation.
|
* implementation.
|
||||||
@ -295,10 +288,6 @@ typedef struct xTASK_PARAMTERS
|
|||||||
* documentation) plus an optional stack buffer and the memory region
|
* documentation) plus an optional stack buffer and the memory region
|
||||||
* definitions.
|
* definitions.
|
||||||
*
|
*
|
||||||
* @param pcName A descriptive name for the task. This is mainly used to
|
|
||||||
* facilitate debugging. Max length defined by tskMAX_TASK_NAME_LEN - default
|
|
||||||
* is 16.
|
|
||||||
*
|
|
||||||
* @param pxCreatedTask Used to pass back a handle by which the created task
|
* @param pxCreatedTask Used to pass back a handle by which the created task
|
||||||
* can be referenced.
|
* can be referenced.
|
||||||
*
|
*
|
||||||
@ -974,7 +963,7 @@ signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask ) PRIVILEGED_FUNCTI
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>volatile portTickType xTaskGetTickCount( void );</PRE>
|
* <PRE>portTickType xTaskGetTickCount( void );</PRE>
|
||||||
*
|
*
|
||||||
* @return The count of ticks since vTaskStartScheduler was called.
|
* @return The count of ticks since vTaskStartScheduler was called.
|
||||||
*
|
*
|
||||||
@ -983,6 +972,22 @@ signed portBASE_TYPE xTaskIsTaskSuspended( xTaskHandle xTask ) PRIVILEGED_FUNCTI
|
|||||||
*/
|
*/
|
||||||
portTickType xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;
|
portTickType xTaskGetTickCount( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* task. h
|
||||||
|
* <PRE>portTickType xTaskGetTickCountFromISR( void );</PRE>
|
||||||
|
*
|
||||||
|
* @return The count of ticks since vTaskStartScheduler was called.
|
||||||
|
*
|
||||||
|
* This is a version of xTaskGetTickCount() that is safe to be called from an
|
||||||
|
* ISR - provided that portTickType is the natural word size of the
|
||||||
|
* microcontroller being used or interrupt nesting is either not supported or
|
||||||
|
* not being used.
|
||||||
|
*
|
||||||
|
* \page xTaskGetTickCount xTaskGetTickCount
|
||||||
|
* \ingroup TaskUtils
|
||||||
|
*/
|
||||||
|
portTickType xTaskGetTickCountFromISR( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>unsigned short uxTaskGetNumberOfTasks( void );</PRE>
|
* <PRE>unsigned short uxTaskGetNumberOfTasks( void );</PRE>
|
||||||
@ -1097,9 +1102,9 @@ unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION;
|
|||||||
* this function to be available.
|
* this function to be available.
|
||||||
*
|
*
|
||||||
* Returns the high water mark of the stack associated with xTask. That is,
|
* Returns the high water mark of the stack associated with xTask. That is,
|
||||||
* the minimum free stack space there has been (in bytes) since the task
|
* the minimum free stack space there has been (in words, so on a 32 bit machine
|
||||||
* started. The smaller the returned number the closer the task has come
|
* a value of 1 means 4 bytes) since the task started. The smaller the returned
|
||||||
* to overflowing its stack.
|
* number the closer the task has come to overflowing its stack.
|
||||||
*
|
*
|
||||||
* @param xTask Handle of the task associated with the stack to be checked.
|
* @param xTask Handle of the task associated with the stack to be checked.
|
||||||
* Set xTask to NULL to check the stack of the calling task.
|
* Set xTask to NULL to check the stack of the calling task.
|
||||||
@ -1109,6 +1114,14 @@ unsigned long ulTaskEndTrace( void ) PRIVILEGED_FUNCTION;
|
|||||||
*/
|
*/
|
||||||
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
|
unsigned portBASE_TYPE uxTaskGetStackHighWaterMark( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
/* When using trace macros it is sometimes necessary to include tasks.h before
|
||||||
|
FreeRTOS.h. When this is done pdTASK_HOOK_CODE will not yet have been defined,
|
||||||
|
so the following two prototypes will cause a compilation error. This can be
|
||||||
|
fixed by simply guarding against the inclusion of these two prototypes unless
|
||||||
|
they are explicitly required by the configUSE_APPLICATION_TASK_TAG configuration
|
||||||
|
constant. */
|
||||||
|
#ifdef configUSE_APPLICATION_TASK_TAG
|
||||||
|
#if configUSE_APPLICATION_TASK_TAG == 1
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction );</pre>
|
* <pre>void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunction );</pre>
|
||||||
@ -1126,6 +1139,8 @@ void vTaskSetApplicationTaskTag( xTaskHandle xTask, pdTASK_HOOK_CODE pxHookFunct
|
|||||||
* Returns the pxHookFunction value assigned to the task xTask.
|
* Returns the pxHookFunction value assigned to the task xTask.
|
||||||
*/
|
*/
|
||||||
pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
|
pdTASK_HOOK_CODE xTaskGetApplicationTaskTag( xTaskHandle xTask ) PRIVILEGED_FUNCTION;
|
||||||
|
#endif /* configUSE_APPLICATION_TASK_TAG ==1 */
|
||||||
|
#endif /* ifdef configUSE_APPLICATION_TASK_TAG */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
@ -1261,7 +1276,7 @@ void vTaskPriorityDisinherit( xTaskHandle * const pxMutexHolder ) PRIVILEGED_FUN
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Generic version of the task creation function which is in turn called by the
|
* Generic version of the task creation function which is in turn called by the
|
||||||
* xTaskCreate() and xTaskCreateProtected() macros.
|
* xTaskCreate() and xTaskCreateRestricted() macros.
|
||||||
*/
|
*/
|
||||||
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;
|
signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pvTaskCode, const signed char * const pcName, unsigned short usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask, portSTACK_TYPE *puxStackBuffer, const xMemoryRegion * const xRegions ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
12
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/list.c
Normal file → Executable file
12
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/list.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -51,14 +51,6 @@
|
|||||||
licensing and training services.
|
licensing and training services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @file list.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
|
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
Normal file → Executable file
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
Normal file → Executable file
@ -1,15 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
* @file port.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -20,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -125,6 +115,7 @@ portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE
|
|||||||
{
|
{
|
||||||
/* Simulate the stack frame as it would be created by a context switch
|
/* Simulate the stack frame as it would be created by a context switch
|
||||||
interrupt. */
|
interrupt. */
|
||||||
|
pxTopOfStack--; /* Offset added to account for the way the MCU uses the stack on entry/exit of interrupts. */
|
||||||
*pxTopOfStack = portINITIAL_XPSR; /* xPSR */
|
*pxTopOfStack = portINITIAL_XPSR; /* xPSR */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* PC */
|
*pxTopOfStack = ( portSTACK_TYPE ) pxCode; /* PC */
|
||||||
@ -164,7 +155,9 @@ void vPortStartFirstTask( void )
|
|||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" ldr r0, [r0] \n"
|
" ldr r0, [r0] \n"
|
||||||
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
" msr msp, r0 \n" /* Set the msp back to the start of the stack. */
|
||||||
|
" cpsie i \n" /* Globally enable interrupts. */
|
||||||
" svc 0 \n" /* System call to start first task. */
|
" svc 0 \n" /* System call to start first task. */
|
||||||
|
" nop \n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
Normal file → Executable file
15
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
Normal file → Executable file
@ -1,15 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file portmacro.h
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -20,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -65,7 +55,6 @@
|
|||||||
#ifndef PORTMACRO_H
|
#ifndef PORTMACRO_H
|
||||||
#define PORTMACRO_H
|
#define PORTMACRO_H
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c
Normal file → Executable file
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
|
10
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c
Normal file → Executable file
10
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -100,7 +100,7 @@ static xBlockLink xStart, xEnd;
|
|||||||
|
|
||||||
/* Keeps track of the number of free bytes remaining, but says nothing about
|
/* Keeps track of the number of free bytes remaining, but says nothing about
|
||||||
fragmentation. */
|
fragmentation. */
|
||||||
static size_t xFreeBytesRemaining;
|
static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE;
|
||||||
|
|
||||||
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
|
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */
|
||||||
|
|
||||||
@ -148,8 +148,6 @@ xBlockLink *pxFirstFreeBlock; \
|
|||||||
pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \
|
pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \
|
||||||
pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE; \
|
pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE; \
|
||||||
pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \
|
pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \
|
||||||
\
|
|
||||||
xFreeBytesRemaining = configTOTAL_HEAP_SIZE; \
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
@ -223,7 +221,7 @@ void *pvReturn = NULL;
|
|||||||
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
|
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
xFreeBytesRemaining -= xWantedSize;
|
xFreeBytesRemaining -= pxBlock->xBlockSize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_3.c
Normal file → Executable file
4
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_3.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
|
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/queue.c
Normal file → Executable file
17
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/queue.c
Normal file → Executable file
@ -1,14 +1,5 @@
|
|||||||
/**
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
* @file queue.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -19,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -424,6 +415,10 @@ size_t xQueueSizeInBytes;
|
|||||||
{
|
{
|
||||||
( pxMutex->uxRecursiveCallCount )++;
|
( pxMutex->uxRecursiveCallCount )++;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
traceTAKE_MUTEX_RECURSIVE_FAILED( pxMutex );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return xReturn;
|
return xReturn;
|
||||||
|
138
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/tasks.c
Normal file → Executable file
138
flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/tasks.c
Normal file → Executable file
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
FreeRTOS V6.0.0 - Copyright (C) 2009 Real Time Engineers Ltd.
|
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||||
|
|
||||||
***************************************************************************
|
***************************************************************************
|
||||||
* *
|
* *
|
||||||
@ -10,7 +10,7 @@
|
|||||||
* + Looking for basic training, *
|
* + Looking for basic training, *
|
||||||
* + Wanting to improve your FreeRTOS skills and productivity *
|
* + Wanting to improve your FreeRTOS skills and productivity *
|
||||||
* *
|
* *
|
||||||
* then take a look at the FreeRTOS eBook *
|
* then take a look at the FreeRTOS books - available as PDF or paperback *
|
||||||
* *
|
* *
|
||||||
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
|
||||||
* http://www.FreeRTOS.org/Documentation *
|
* http://www.FreeRTOS.org/Documentation *
|
||||||
@ -51,16 +51,6 @@
|
|||||||
licensing and training services.
|
licensing and training services.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @file tasks.c
|
|
||||||
* @author FreeRTOS
|
|
||||||
* @addtogroup PIOS PIOS Core hardware abstraction layer
|
|
||||||
* @{
|
|
||||||
* @addtogroup FreeRTOS FreeRTOS Operating system
|
|
||||||
* @{
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -82,8 +72,6 @@ task.h is included from an application file. */
|
|||||||
*/
|
*/
|
||||||
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE
|
#define tskIDLE_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||||
|
|
||||||
#define tskIDLE_PRIORITY ( ( unsigned portBASE_TYPE ) 0 )
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Task control block. A task control block (TCB) is allocated to each task,
|
* Task control block. A task control block (TCB) is allocated to each task,
|
||||||
* and stores the context of the task.
|
* and stores the context of the task.
|
||||||
@ -399,7 +387,6 @@ signed portBASE_TYPE xTaskGenericCreate( pdTASK_CODE pxTaskCode, const signed ch
|
|||||||
{
|
{
|
||||||
signed portBASE_TYPE xReturn;
|
signed portBASE_TYPE xReturn;
|
||||||
tskTCB * pxNewTCB;
|
tskTCB * pxNewTCB;
|
||||||
portBASE_TYPE xRunPrivileged;
|
|
||||||
|
|
||||||
/* Allocate the memory required by the TCB and stack for the new task,
|
/* Allocate the memory required by the TCB and stack for the new task,
|
||||||
checking that the allocation was successful. */
|
checking that the allocation was successful. */
|
||||||
@ -409,7 +396,9 @@ portBASE_TYPE xRunPrivileged;
|
|||||||
{
|
{
|
||||||
portSTACK_TYPE *pxTopOfStack;
|
portSTACK_TYPE *pxTopOfStack;
|
||||||
|
|
||||||
|
#if( portUSING_MPU_WRAPPERS == 1 )
|
||||||
/* Should the task be created in privileged mode? */
|
/* Should the task be created in privileged mode? */
|
||||||
|
portBASE_TYPE xRunPrivileged;
|
||||||
if( ( uxPriority & portPRIVILEGE_BIT ) != 0x00 )
|
if( ( uxPriority & portPRIVILEGE_BIT ) != 0x00 )
|
||||||
{
|
{
|
||||||
xRunPrivileged = pdTRUE;
|
xRunPrivileged = pdTRUE;
|
||||||
@ -419,6 +408,7 @@ portBASE_TYPE xRunPrivileged;
|
|||||||
xRunPrivileged = pdFALSE;
|
xRunPrivileged = pdFALSE;
|
||||||
}
|
}
|
||||||
uxPriority &= ~portPRIVILEGE_BIT;
|
uxPriority &= ~portPRIVILEGE_BIT;
|
||||||
|
#endif /* portUSING_MPU_WRAPPERS == 1 */
|
||||||
|
|
||||||
/* Calculate the top of stack address. This depends on whether the
|
/* Calculate the top of stack address. This depends on whether the
|
||||||
stack grows from high memory to low (as per the 80x86) or visa versa.
|
stack grows from high memory to low (as per the 80x86) or visa versa.
|
||||||
@ -454,25 +444,36 @@ portBASE_TYPE xRunPrivileged;
|
|||||||
#else
|
#else
|
||||||
{
|
{
|
||||||
pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );
|
pxNewTCB->pxTopOfStack = pxPortInitialiseStack( pxTopOfStack, pxTaskCode, pvParameters );
|
||||||
( void ) xRunPrivileged;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if( ( void * ) pxCreatedTask != NULL )
|
||||||
|
{
|
||||||
|
/* Pass the TCB out - in an anonymous way. The calling function/
|
||||||
|
task can use this as a handle to delete the task later if
|
||||||
|
required.*/
|
||||||
|
*pxCreatedTask = ( xTaskHandle ) pxNewTCB;
|
||||||
|
}
|
||||||
|
|
||||||
/* We are going to manipulate the task queues to add this task to a
|
/* We are going to manipulate the task queues to add this task to a
|
||||||
ready list, so must make sure no interrupts occur. */
|
ready list, so must make sure no interrupts occur. */
|
||||||
portENTER_CRITICAL();
|
portENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uxCurrentNumberOfTasks++;
|
uxCurrentNumberOfTasks++;
|
||||||
if( uxCurrentNumberOfTasks == ( unsigned portBASE_TYPE ) 1 )
|
if( pxCurrentTCB == NULL )
|
||||||
{
|
{
|
||||||
/* As this is the first task it must also be the current task. */
|
/* There are no other tasks, or all the other tasks are in
|
||||||
|
the suspended state - make this the current task. */
|
||||||
pxCurrentTCB = pxNewTCB;
|
pxCurrentTCB = pxNewTCB;
|
||||||
|
|
||||||
|
if( uxCurrentNumberOfTasks == ( unsigned portBASE_TYPE ) 1 )
|
||||||
|
{
|
||||||
/* This is the first task to be created so do the preliminary
|
/* This is the first task to be created so do the preliminary
|
||||||
initialisation required. We will not recover if this call
|
initialisation required. We will not recover if this call
|
||||||
fails, but we will report the failure. */
|
fails, but we will report the failure. */
|
||||||
prvInitialiseTaskLists();
|
prvInitialiseTaskLists();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the scheduler is not already running, make this task the
|
/* If the scheduler is not already running, make this task the
|
||||||
@ -512,19 +513,11 @@ portBASE_TYPE xRunPrivileged;
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
|
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;
|
||||||
traceTASK_CREATE_FAILED( pxNewTCB );
|
traceTASK_CREATE_FAILED();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xReturn == pdPASS )
|
if( xReturn == pdPASS )
|
||||||
{
|
{
|
||||||
if( ( void * ) pxCreatedTask != NULL )
|
|
||||||
{
|
|
||||||
/* Pass the TCB out - in an anonymous way. The calling function/
|
|
||||||
task can use this as a handle to delete the task later if
|
|
||||||
required.*/
|
|
||||||
*pxCreatedTask = ( xTaskHandle ) pxNewTCB;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( xSchedulerRunning != pdFALSE )
|
if( xSchedulerRunning != pdFALSE )
|
||||||
{
|
{
|
||||||
/* If the created task is of a higher priority than the current task
|
/* If the created task is of a higher priority than the current task
|
||||||
@ -904,11 +897,32 @@ portBASE_TYPE xRunPrivileged;
|
|||||||
}
|
}
|
||||||
portEXIT_CRITICAL();
|
portEXIT_CRITICAL();
|
||||||
|
|
||||||
/* We may have just suspended the current task. */
|
|
||||||
if( ( void * ) pxTaskToSuspend == NULL )
|
if( ( void * ) pxTaskToSuspend == NULL )
|
||||||
{
|
{
|
||||||
|
if( xSchedulerRunning != pdFALSE )
|
||||||
|
{
|
||||||
|
/* We have just suspended the current task. */
|
||||||
portYIELD_WITHIN_API();
|
portYIELD_WITHIN_API();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The scheduler is not running, but the task that was pointed
|
||||||
|
to by pxCurrentTCB has just been suspended and pxCurrentTCB
|
||||||
|
must be adjusted to point to a different task. */
|
||||||
|
if( uxCurrentNumberOfTasks == 1 )
|
||||||
|
{
|
||||||
|
/* No other tasks are defined, so set pxCurrentTCB back to
|
||||||
|
NULL so when the next task is created pxCurrentTCB will
|
||||||
|
be set to point to it no matter what its relative priority
|
||||||
|
is. */
|
||||||
|
pxCurrentTCB = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vTaskSwitchContext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@ -1186,6 +1200,12 @@ portTickType xTicks;
|
|||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
portTickType xTaskGetTickCountFromISR( void )
|
||||||
|
{
|
||||||
|
return xTickCount;
|
||||||
|
}
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
|
unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
|
||||||
{
|
{
|
||||||
/* A critical section is not required because the variables are of type
|
/* A critical section is not required because the variables are of type
|
||||||
@ -1262,13 +1282,23 @@ unsigned portBASE_TYPE uxTaskGetNumberOfTasks( void )
|
|||||||
void vTaskGetRunTimeStats( signed char *pcWriteBuffer )
|
void vTaskGetRunTimeStats( signed char *pcWriteBuffer )
|
||||||
{
|
{
|
||||||
unsigned portBASE_TYPE uxQueue;
|
unsigned portBASE_TYPE uxQueue;
|
||||||
unsigned long ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
|
unsigned long ulTotalRunTime;
|
||||||
|
|
||||||
/* This is a VERY costly function that should be used for debug only.
|
/* This is a VERY costly function that should be used for debug only.
|
||||||
It leaves interrupts disabled for a LONG time. */
|
It leaves interrupts disabled for a LONG time. */
|
||||||
|
|
||||||
vTaskSuspendAll();
|
vTaskSuspendAll();
|
||||||
{
|
{
|
||||||
|
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
|
||||||
|
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTotalRunTime );
|
||||||
|
#else
|
||||||
|
ulTotalRunTime = portGET_RUN_TIME_COUNTER_VALUE();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Divide ulTotalRunTime by 100 to make the percentage caluclations
|
||||||
|
simpler in the prvGenerateRunTimeStatsForTasksInList() function. */
|
||||||
|
ulTotalRunTime /= 100UL;
|
||||||
|
|
||||||
/* Run through all the lists that could potentially contain a TCB,
|
/* Run through all the lists that could potentially contain a TCB,
|
||||||
generating a table of run timer percentages in the provided
|
generating a table of run timer percentages in the provided
|
||||||
buffer. */
|
buffer. */
|
||||||
@ -1574,7 +1604,13 @@ void vTaskSwitchContext( void )
|
|||||||
|
|
||||||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||||
{
|
{
|
||||||
unsigned long ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();
|
unsigned long ulTempCounter;
|
||||||
|
|
||||||
|
#ifdef portALT_GET_RUN_TIME_COUNTER_VALUE
|
||||||
|
portALT_GET_RUN_TIME_COUNTER_VALUE( ulTempCounter );
|
||||||
|
#else
|
||||||
|
ulTempCounter = portGET_RUN_TIME_COUNTER_VALUE();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Add the amount of time the task has been running to the accumulated
|
/* Add the amount of time the task has been running to the accumulated
|
||||||
time so far. The time the task started running was stored in
|
time so far. The time the task started running was stored in
|
||||||
@ -1753,7 +1789,7 @@ portBASE_TYPE xReturn;
|
|||||||
passed since vTaskSetTimeout() was called. */
|
passed since vTaskSetTimeout() was called. */
|
||||||
xReturn = pdTRUE;
|
xReturn = pdTRUE;
|
||||||
}
|
}
|
||||||
else if( ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) < ( portTickType ) *pxTicksToWait )
|
else if( ( ( portTickType ) ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering ) ) < ( portTickType ) *pxTicksToWait )
|
||||||
{
|
{
|
||||||
/* Not a genuine timeout. Adjust parameters for time remaining. */
|
/* Not a genuine timeout. Adjust parameters for time remaining. */
|
||||||
*pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );
|
*pxTicksToWait -= ( ( portTickType ) xTickCount - ( portTickType ) pxTimeOut->xTimeOnEntering );
|
||||||
@ -2049,7 +2085,16 @@ tskTCB *pxNewTCB;
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );
|
listGET_OWNER_OF_NEXT_ENTRY( pxNextTCB, pxList );
|
||||||
|
#if ( portSTACK_GROWTH > 0 )
|
||||||
|
{
|
||||||
|
usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxEndOfStack );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );
|
usStackRemaining = usTaskCheckFreeStackSpace( ( unsigned char * ) pxNextTCB->pxStack );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
|
sprintf( pcStatusString, ( char * ) "%s\t\t%c\t%u\t%u\t%u\r\n", pxNextTCB->pcTaskName, cStatus, ( unsigned int ) pxNextTCB->uxPriority, usStackRemaining, ( unsigned int ) pxNextTCB->uxTCBNumber );
|
||||||
strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );
|
strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatusString );
|
||||||
|
|
||||||
@ -2084,20 +2129,41 @@ tskTCB *pxNewTCB;
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* What percentage of the total run time as the task used?
|
/* What percentage of the total run time has the task used?
|
||||||
This will always be rounded down to the nearest integer. */
|
This will always be rounded down to the nearest integer.
|
||||||
ulStatsAsPercentage = ( 100UL * pxNextTCB->ulRunTimeCounter ) / ulTotalRunTime;
|
ulTotalRunTime has already been divided by 100. */
|
||||||
|
ulStatsAsPercentage = pxNextTCB->ulRunTimeCounter / ulTotalRunTime;
|
||||||
|
|
||||||
if( ulStatsAsPercentage > 0UL )
|
if( ulStatsAsPercentage > 0UL )
|
||||||
{
|
{
|
||||||
|
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
|
||||||
|
{
|
||||||
|
sprintf( pcStatsString, ( char * ) "%s\t\t%lu\t\t%lu%%\r\n", pxNextTCB->pcTaskName, pxNextTCB->ulRunTimeCounter, ulStatsAsPercentage );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
/* sizeof( int ) == sizeof( long ) so a smaller
|
||||||
|
printf() library can be used. */
|
||||||
sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
|
sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t%u%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter, ( unsigned int ) ulStatsAsPercentage );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the percentage is zero here then the task has
|
/* If the percentage is zero here then the task has
|
||||||
consumed less than 1% of the total run time. */
|
consumed less than 1% of the total run time. */
|
||||||
|
#ifdef portLU_PRINTF_SPECIFIER_REQUIRED
|
||||||
|
{
|
||||||
|
sprintf( pcStatsString, ( char * ) "%s\t\t%lu\t\t<1%%\r\n", pxNextTCB->pcTaskName, pxNextTCB->ulRunTimeCounter );
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
/* sizeof( int ) == sizeof( long ) so a smaller
|
||||||
|
printf() library can be used. */
|
||||||
sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );
|
sprintf( pcStatsString, ( char * ) "%s\t\t%u\t\t<1%%\r\n", pxNextTCB->pcTaskName, ( unsigned int ) pxNextTCB->ulRunTimeCounter );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatsString );
|
strcat( ( char * ) pcWriteBuffer, ( char * ) pcStatsString );
|
||||||
@ -2284,7 +2350,7 @@ tskTCB *pxNewTCB;
|
|||||||
|
|
||||||
if( xSchedulerRunning != pdFALSE )
|
if( xSchedulerRunning != pdFALSE )
|
||||||
{
|
{
|
||||||
pxCurrentTCB->uxCriticalNesting++;
|
( pxCurrentTCB->uxCriticalNesting )++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2299,7 +2365,7 @@ void vTaskExitCritical( void )
|
|||||||
{
|
{
|
||||||
if( pxCurrentTCB->uxCriticalNesting > 0 )
|
if( pxCurrentTCB->uxCriticalNesting > 0 )
|
||||||
{
|
{
|
||||||
pxCurrentTCB->uxCriticalNesting--;
|
( pxCurrentTCB->uxCriticalNesting )--;
|
||||||
|
|
||||||
if( pxCurrentTCB->uxCriticalNesting == 0 )
|
if( pxCurrentTCB->uxCriticalNesting == 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user