mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 09:07:46 -04:00
Merge remote-tracking branch 'upstream/master' into vTaskStepTick-improvement
This commit is contained in:
commit
2417af9a9b
499 changed files with 82065 additions and 77566 deletions
27
History.txt
27
History.txt
|
@ -1,8 +1,8 @@
|
||||||
Documentation and download available at http://www.FreeRTOS.org/
|
Documentation and download available at https://www.FreeRTOS.org/
|
||||||
|
|
||||||
Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020
|
Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020
|
||||||
|
|
||||||
See http://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
|
See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
|
||||||
|
|
||||||
+ ./FreeRTOS-Labs directory was removed from this file. The libraries it
|
+ ./FreeRTOS-Labs directory was removed from this file. The libraries it
|
||||||
contained are now available as a separate download.
|
contained are now available as a separate download.
|
||||||
|
@ -11,7 +11,7 @@ Changes between FreeRTOS V10.3.0 and FreeRTOS V10.3.1 released February 18 2020
|
||||||
|
|
||||||
Changes between FreeRTOS V10.2.1 and FreeRTOS V10.3.0 released February 7 2020
|
Changes between FreeRTOS V10.2.1 and FreeRTOS V10.3.0 released February 7 2020
|
||||||
|
|
||||||
See http://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
|
See https://www.FreeRTOS.org/FreeRTOS-V10.3.x.html
|
||||||
|
|
||||||
New and updated kernel ports:
|
New and updated kernel ports:
|
||||||
|
|
||||||
|
@ -205,8 +205,8 @@ Changes between FreeRTOS V9.0.1 and FreeRTOS V10.0.0:
|
||||||
|
|
||||||
New Features and components:
|
New Features and components:
|
||||||
|
|
||||||
+ Stream Buffers - see http://www.FreeRTOS.org/RTOS-stream-buffer-example.html
|
+ Stream Buffers - see https://www.FreeRTOS.org/RTOS-stream-buffer-example.html
|
||||||
+ Message Buffers - see http://www.FreeRTOS.org//RTOS-message-buffer-example.html
|
+ Message Buffers - see https://www.FreeRTOS.org//RTOS-message-buffer-example.html
|
||||||
+ Move FreeRTOS+TCP into the main repository, along with the basic Win32
|
+ Move FreeRTOS+TCP into the main repository, along with the basic Win32
|
||||||
TCP demo FreeRTOS_Plus_TCP_Minimal_Windows_Simulator.
|
TCP demo FreeRTOS_Plus_TCP_Minimal_Windows_Simulator.
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ Changes since FreeRTOS V9.0.0:
|
||||||
|
|
||||||
Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
|
Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
|
||||||
|
|
||||||
See http://www.FreeRTOS.org/FreeRTOS-V9.html
|
See https://www.FreeRTOS.org/FreeRTOS-V9.html
|
||||||
|
|
||||||
RTOS kernel updates:
|
RTOS kernel updates:
|
||||||
|
|
||||||
|
@ -366,7 +366,7 @@ Changes between FreeRTOS V9.0.0 and FreeRTOS V9.0.0rc2 released May 25 2016:
|
||||||
Changes between FreeRTOS V9.0.0rc1 and FreeRTOS V9.0.0rc2 (release candidate 2)
|
Changes between FreeRTOS V9.0.0rc1 and FreeRTOS V9.0.0rc2 (release candidate 2)
|
||||||
released March 30 2016:
|
released March 30 2016:
|
||||||
|
|
||||||
NOTE - See http://www.FreeRTOS.org/FreeRTOS-V9.html for details
|
NOTE - See https://www.FreeRTOS.org/FreeRTOS-V9.html for details
|
||||||
|
|
||||||
+ The functions that create RTOS objects using static memory allocation have
|
+ The functions that create RTOS objects using static memory allocation have
|
||||||
been simplified and will not revert to using dynamic allocation if a
|
been simplified and will not revert to using dynamic allocation if a
|
||||||
|
@ -579,7 +579,7 @@ Changes between V8.1.2 and V8.2.0 released 16th January 2015
|
||||||
Significant RTOS kernel updates:
|
Significant RTOS kernel updates:
|
||||||
|
|
||||||
+ MAJOR NEW FEATURE! Task notifications. Please see the following URL for
|
+ MAJOR NEW FEATURE! Task notifications. Please see the following URL for
|
||||||
details: http://www.FreeRTOS.org/RTOS-task-notifications.html
|
details: https://www.FreeRTOS.org/RTOS-task-notifications.html
|
||||||
+ NEW HEADER FILE REQUIRED! Obsolete definitions have been separated into
|
+ NEW HEADER FILE REQUIRED! Obsolete definitions have been separated into
|
||||||
a new header file called FreeRTOS/Source/include/deprecated_definitions.h.
|
a new header file called FreeRTOS/Source/include/deprecated_definitions.h.
|
||||||
This header file must be present to build. Note some of the obsolete
|
This header file must be present to build. Note some of the obsolete
|
||||||
|
@ -969,7 +969,7 @@ Changes between V7.4.1 and V7.4.2 released May 1 2013
|
||||||
|
|
||||||
+ Added FreeRTOS+FAT SL source code and demo project. The demo project
|
+ Added FreeRTOS+FAT SL source code and demo project. The demo project
|
||||||
runs in the FreeRTOS Windows simulator for easy and hardware independent
|
runs in the FreeRTOS Windows simulator for easy and hardware independent
|
||||||
experimentation and evaluation. See http://www.FreeRTOS.org/fat_sl
|
experimentation and evaluation. See https://www.FreeRTOS.org/fat_sl
|
||||||
|
|
||||||
Changes between V7.4.0 and V7.4.1 released April 18 2013
|
Changes between V7.4.0 and V7.4.1 released April 18 2013
|
||||||
|
|
||||||
|
@ -998,7 +998,7 @@ Changes between V7.4.0 and V7.4.1 released April 18 2013
|
||||||
Changes between V7.3.0 and V7.4.0 released February 20 2013
|
Changes between V7.3.0 and V7.4.0 released February 20 2013
|
||||||
|
|
||||||
+ New feature: Queue sets. See:
|
+ New feature: Queue sets. See:
|
||||||
http://www.FreeRTOS.org/Pend-on-multiple-rtos-objects.html
|
https://www.FreeRTOS.org/Pend-on-multiple-rtos-objects.html
|
||||||
+ Overhauled the default tickless idle mode implementation provided with the
|
+ Overhauled the default tickless idle mode implementation provided with the
|
||||||
ARM Cortex-M3 port layers.
|
ARM Cortex-M3 port layers.
|
||||||
+ Enhanced tickless support in the core kernel code with the introduction of
|
+ Enhanced tickless support in the core kernel code with the introduction of
|
||||||
|
@ -1145,7 +1145,7 @@ Changes between V7.1.0 and V7.1.1 released May 1 2012
|
||||||
|
|
||||||
+ Introduced the portSETUP_TCB() macro to remove the requirement for the
|
+ Introduced the portSETUP_TCB() macro to remove the requirement for the
|
||||||
Windows simulator to use the traceTASK_CREATE() macro, leaving the trace
|
Windows simulator to use the traceTASK_CREATE() macro, leaving the trace
|
||||||
macro available for use by FreeRTOS+Trace (http://www.FreeRTOS.org/trace).
|
macro available for use by FreeRTOS+Trace (https://www.FreeRTOS.org/trace).
|
||||||
+ Added a new trace macro, traceMOVE_TASK_TO_READY_STATE(), to allow future
|
+ Added a new trace macro, traceMOVE_TASK_TO_READY_STATE(), to allow future
|
||||||
FreeRTOS+Trace versions to provide even more information to users.
|
FreeRTOS+Trace versions to provide even more information to users.
|
||||||
+ Updated the FreeRTOS MPU port to be correct for changes that were
|
+ Updated the FreeRTOS MPU port to be correct for changes that were
|
||||||
|
@ -1173,7 +1173,7 @@ Changes between V7.1.0 and V7.1.1 released May 1 2012
|
||||||
|
|
||||||
+ The command interpreter has now been formally released as FreeRTOS+CLI,
|
+ The command interpreter has now been formally released as FreeRTOS+CLI,
|
||||||
and been moved out of the main FreeRTOS download, to instead be available
|
and been moved out of the main FreeRTOS download, to instead be available
|
||||||
from the FreeRTOS+ Ecosystem site http://www.FreeRTOS.org/plus.
|
from the FreeRTOS+ Ecosystem site https://www.FreeRTOS.org/plus.
|
||||||
+ flash_timer.c/h has been added to the list of standard demo tasks. This
|
+ flash_timer.c/h has been added to the list of standard demo tasks. This
|
||||||
performs the same functionality as the flash.c tasks, but using software
|
performs the same functionality as the flash.c tasks, but using software
|
||||||
timers in place of tasks.
|
timers in place of tasks.
|
||||||
|
@ -1748,9 +1748,6 @@ Changes between V4.8.0 and V5.0.0 released April 15, 2008
|
||||||
compiler might not issue any type mismatch warnings!
|
compiler might not issue any type mismatch warnings!
|
||||||
|
|
||||||
|
|
||||||
See http://www.FreeRTOS.org/upgrading.html for full information.
|
|
||||||
|
|
||||||
|
|
||||||
Other changes:
|
Other changes:
|
||||||
|
|
||||||
+ Support added for the new Luminary Micro LM3S3768 and LM3S3748 Cortex-M3
|
+ Support added for the new Luminary Micro LM3S3768 and LM3S3748 Cortex-M3
|
||||||
|
|
|
@ -29,3 +29,7 @@ is normally only used on very memory limited systems.
|
||||||
See the readme file in the ```./portable``` directory for more information.
|
See the readme file in the ```./portable``` directory for more information.
|
||||||
|
|
||||||
- The ```./include``` directory contains the real time kernel header files.
|
- The ```./include``` directory contains the real time kernel header files.
|
||||||
|
|
||||||
|
### Code Formatting
|
||||||
|
FreeRTOS files are formatted using the "uncrustify" tool. The configuration file used by uncrustify can be found in the [FreeRTOS/FreeRTOS repository](https://github.com/FreeRTOS/FreeRTOS/blob/master/tools/uncrustify.cfg).
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Standard includes. */
|
/* Standard includes. */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
|
@ -48,9 +47,11 @@
|
||||||
*/
|
*/
|
||||||
#include <stdint.h> /* READ COMMENT ABOVE. */
|
#include <stdint.h> /* READ COMMENT ABOVE. */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* Application specific configuration options. */
|
/* Application specific configuration options. */
|
||||||
#include "FreeRTOSConfig.h"
|
#include "FreeRTOSConfig.h"
|
||||||
|
@ -1315,8 +1316,10 @@
|
||||||
/* Message buffers are built on stream buffers. */
|
/* Message buffers are built on stream buffers. */
|
||||||
typedef StaticStreamBuffer_t StaticMessageBuffer_t;
|
typedef StaticStreamBuffer_t StaticMessageBuffer_t;
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* INC_FREERTOS_H */
|
#endif /* INC_FREERTOS_H */
|
||||||
|
|
|
@ -19,114 +19,14 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STACK_MACROS_H
|
|
||||||
#define STACK_MACROS_H
|
|
||||||
|
|
||||||
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
#ifndef _MSC_VER /* Visual Studio doesn't support #warning. */
|
||||||
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
#warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
#include "stack_macros.h"
|
||||||
* Call the stack overflow hook function if the stack of the task being swapped
|
|
||||||
* out is currently overflowed, or looks like it might have overflowed in the
|
|
||||||
* past.
|
|
||||||
*
|
|
||||||
* Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
|
|
||||||
* the current stack state only - comparing the current top of stack value to
|
|
||||||
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
|
|
||||||
* will also cause the last few stack bytes to be checked to ensure the value
|
|
||||||
* to which the bytes were set when the task was created have not been
|
|
||||||
* overwritten. Note this second test does not guarantee that an overflowed
|
|
||||||
* stack will always be recognised.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
|
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
|
||||||
if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
|
|
||||||
|
|
||||||
/* Only the current stack state is to be checked. */
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
\
|
|
||||||
/* Is the currently saved stack pointer within the stack limit? */ \
|
|
||||||
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
|
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
|
|
||||||
const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
|
|
||||||
\
|
|
||||||
if( ( pulStack[ 0 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 1 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 2 ] != ulCheckValue ) || \
|
|
||||||
( pulStack[ 3 ] != ulCheckValue ) ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
|
|
||||||
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW() \
|
|
||||||
{ \
|
|
||||||
int8_t * pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
|
|
||||||
static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
|
|
||||||
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
|
|
||||||
\
|
|
||||||
\
|
|
||||||
pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
|
|
||||||
\
|
|
||||||
/* Has the extremity of the task stack ever been written over? */ \
|
|
||||||
if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
|
|
||||||
{ \
|
|
||||||
vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* Remove stack overflow macro if not being used. */
|
|
||||||
#ifndef taskCHECK_FOR_STACK_OVERFLOW
|
|
||||||
#define taskCHECK_FOR_STACK_OVERFLOW()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* STACK_MACROS_H */
|
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,9 +43,11 @@
|
||||||
/* Standard includes. */
|
/* Standard includes. */
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Port specific definitions -- entering/exiting critical section.
|
* Port specific definitions -- entering/exiting critical section.
|
||||||
|
@ -407,8 +408,10 @@
|
||||||
return ulCurrent;
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ATOMIC_H */
|
#endif /* ATOMIC_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CO_ROUTINE_H
|
#ifndef CO_ROUTINE_H
|
||||||
|
@ -34,9 +33,11 @@
|
||||||
|
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* Used to hide the implementation of the co-routine control block. The
|
/* Used to hide the implementation of the co-routine control block. The
|
||||||
* control block structure however has to be included in the header due to
|
* control block structure however has to be included in the header due to
|
||||||
|
@ -64,7 +65,8 @@
|
||||||
* crCOROUTINE_CODE pxCoRoutineCode,
|
* crCOROUTINE_CODE pxCoRoutineCode,
|
||||||
* UBaseType_t uxPriority,
|
* UBaseType_t uxPriority,
|
||||||
* UBaseType_t uxIndex
|
* UBaseType_t uxIndex
|
||||||
* );</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Create a new co-routine and add it to the list of co-routines that are
|
* Create a new co-routine and add it to the list of co-routines that are
|
||||||
* ready to run.
|
* ready to run.
|
||||||
|
@ -137,7 +139,8 @@
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* void vCoRoutineSchedule( void );</pre>
|
* void vCoRoutineSchedule( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Run a co-routine.
|
* Run a co-routine.
|
||||||
*
|
*
|
||||||
|
@ -178,7 +181,8 @@
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* crSTART( CoRoutineHandle_t xHandle );</pre>
|
* crSTART( CoRoutineHandle_t xHandle );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* This macro MUST always be called at the start of a co-routine function.
|
* This macro MUST always be called at the start of a co-routine function.
|
||||||
*
|
*
|
||||||
|
@ -200,7 +204,8 @@
|
||||||
*
|
*
|
||||||
* // Must end every co-routine with a call to crEND();
|
* // Must end every co-routine with a call to crEND();
|
||||||
* crEND();
|
* crEND();
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crSTART crSTART
|
* \defgroup crSTART crSTART
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
@ -211,7 +216,8 @@
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* crEND();</pre>
|
* crEND();
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* This macro MUST always be called at the end of a co-routine function.
|
* This macro MUST always be called at the end of a co-routine function.
|
||||||
*
|
*
|
||||||
|
@ -233,7 +239,8 @@
|
||||||
*
|
*
|
||||||
* // Must end every co-routine with a call to crEND();
|
* // Must end every co-routine with a call to crEND();
|
||||||
* crEND();
|
* crEND();
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crSTART crSTART
|
* \defgroup crSTART crSTART
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
@ -253,7 +260,8 @@
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* crDELAY( CoRoutineHandle_t xHandle, TickType_t xTicksToDelay );</pre>
|
* crDELAY( CoRoutineHandle_t xHandle, TickType_t xTicksToDelay );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Delay a co-routine for a fixed period of time.
|
* Delay a co-routine for a fixed period of time.
|
||||||
*
|
*
|
||||||
|
@ -292,7 +300,8 @@
|
||||||
*
|
*
|
||||||
* // Must end every co-routine with a call to crEND();
|
* // Must end every co-routine with a call to crEND();
|
||||||
* crEND();
|
* crEND();
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crDELAY crDELAY
|
* \defgroup crDELAY crDELAY
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
@ -311,7 +320,8 @@
|
||||||
* void *pvItemToQueue,
|
* void *pvItemToQueue,
|
||||||
* TickType_t xTicksToWait,
|
* TickType_t xTicksToWait,
|
||||||
* BaseType_t *pxResult
|
* BaseType_t *pxResult
|
||||||
* )</pre>
|
* )
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
||||||
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
||||||
|
@ -382,7 +392,8 @@
|
||||||
*
|
*
|
||||||
* // Co-routines must end with a call to crEND().
|
* // Co-routines must end with a call to crEND().
|
||||||
* crEND();
|
* crEND();
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crQUEUE_SEND crQUEUE_SEND
|
* \defgroup crQUEUE_SEND crQUEUE_SEND
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
@ -410,7 +421,8 @@
|
||||||
* void *pvBuffer,
|
* void *pvBuffer,
|
||||||
* TickType_t xTicksToWait,
|
* TickType_t xTicksToWait,
|
||||||
* BaseType_t *pxResult
|
* BaseType_t *pxResult
|
||||||
* )</pre>
|
* )
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
* The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine
|
||||||
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
* equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.
|
||||||
|
@ -474,7 +486,8 @@
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
* crEND();
|
* crEND();
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
|
* \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
|
@ -500,7 +513,8 @@
|
||||||
* QueueHandle_t pxQueue,
|
* QueueHandle_t pxQueue,
|
||||||
* void *pvItemToQueue,
|
* void *pvItemToQueue,
|
||||||
* BaseType_t xCoRoutinePreviouslyWoken
|
* BaseType_t xCoRoutinePreviouslyWoken
|
||||||
* )</pre>
|
* )
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
||||||
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
||||||
|
@ -583,11 +597,13 @@
|
||||||
* // many characters are posted to the queue.
|
* // many characters are posted to the queue.
|
||||||
* xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
|
* xCRWokenByPost = crQUEUE_SEND_FROM_ISR( xCommsRxQueue, &cRxedChar, xCRWokenByPost );
|
||||||
* }
|
* }
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
|
* \defgroup crQUEUE_SEND_FROM_ISR crQUEUE_SEND_FROM_ISR
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )
|
#define crQUEUE_SEND_FROM_ISR( pxQueue, pvItemToQueue, xCoRoutinePreviouslyWoken ) \
|
||||||
|
xQueueCRSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( xCoRoutinePreviouslyWoken ) )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -597,7 +613,8 @@
|
||||||
* QueueHandle_t pxQueue,
|
* QueueHandle_t pxQueue,
|
||||||
* void *pvBuffer,
|
* void *pvBuffer,
|
||||||
* BaseType_t * pxCoRoutineWoken
|
* BaseType_t * pxCoRoutineWoken
|
||||||
* )</pre>
|
* )
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
* The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the
|
||||||
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
* co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()
|
||||||
|
@ -696,11 +713,13 @@
|
||||||
* SEND_CHARACTER( cCharToTx );
|
* SEND_CHARACTER( cCharToTx );
|
||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
* }</pre>
|
* }
|
||||||
|
* </pre>
|
||||||
* \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
|
* \defgroup crQUEUE_RECEIVE_FROM_ISR crQUEUE_RECEIVE_FROM_ISR
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )
|
#define crQUEUE_RECEIVE_FROM_ISR( pxQueue, pvBuffer, pxCoRoutineWoken ) \
|
||||||
|
xQueueCRReceiveFromISR( ( pxQueue ), ( pvBuffer ), ( pxCoRoutineWoken ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is intended for internal use by the co-routine macros only.
|
* This function is intended for internal use by the co-routine macros only.
|
||||||
|
@ -723,8 +742,10 @@
|
||||||
*/
|
*/
|
||||||
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
|
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* CO_ROUTINE_H */
|
#endif /* CO_ROUTINE_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DEPRECATED_DEFINITIONS_H
|
#ifndef DEPRECATED_DEFINITIONS_H
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EVENT_GROUPS_H
|
#ifndef EVENT_GROUPS_H
|
||||||
|
@ -35,9 +34,11 @@
|
||||||
/* FreeRTOS includes. */
|
/* FreeRTOS includes. */
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An event group is a collection of bits to which an application can assign a
|
* An event group is a collection of bits to which an application can assign a
|
||||||
|
@ -413,7 +414,8 @@
|
||||||
BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
|
BaseType_t xEventGroupClearBitsFromISR( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
|
#define xEventGroupClearBitsFromISR( xEventGroup, uxBitsToClear ) \
|
||||||
|
xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -568,7 +570,8 @@
|
||||||
const EventBits_t uxBitsToSet,
|
const EventBits_t uxBitsToSet,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
|
#define xEventGroupSetBitsFromISR( xEventGroup, uxBitsToSet, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -763,8 +766,10 @@
|
||||||
UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* EVENT_GROUPS_H */
|
#endif /* EVENT_GROUPS_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -53,13 +52,14 @@
|
||||||
* \ingroup FreeRTOSIntro
|
* \ingroup FreeRTOSIntro
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
|
||||||
#error FreeRTOS.h must be included before list.h
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LIST_H
|
#ifndef LIST_H
|
||||||
#define LIST_H
|
#define LIST_H
|
||||||
|
|
||||||
|
#ifndef INC_FREERTOS_H
|
||||||
|
#error "FreeRTOS.h must be included before list.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The list structure members are modified from within interrupts, and therefore
|
* The list structure members are modified from within interrupts, and therefore
|
||||||
* by rights should be declared volatile. However, they are only modified in a
|
* by rights should be declared volatile. However, they are only modified in a
|
||||||
|
@ -92,9 +92,11 @@
|
||||||
#define configLIST_VOLATILE
|
#define configLIST_VOLATILE
|
||||||
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/* Macros that can be used to place known values within the list structures,
|
/* Macros that can be used to place known values within the list structures,
|
||||||
* then check that the known values do not get corrupted during the execution of
|
* then check that the known values do not get corrupted during the execution of
|
||||||
|
@ -406,8 +408,10 @@
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ifndef LIST_H */
|
#endif /* ifndef LIST_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,9 +68,11 @@
|
||||||
/* Message buffers are built onto of stream buffers. */
|
/* Message buffers are built onto of stream buffers. */
|
||||||
#include "stream_buffer.h"
|
#include "stream_buffer.h"
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( __cplusplus )
|
#if defined( __cplusplus )
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type by which message buffers are referenced. For example, a call to
|
* Type by which message buffers are referenced. For example, a call to
|
||||||
|
@ -139,7 +140,8 @@
|
||||||
* \defgroup xMessageBufferCreate xMessageBufferCreate
|
* \defgroup xMessageBufferCreate xMessageBufferCreate
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferCreate( xBufferSizeBytes ) ( MessageBufferHandle_t ) xStreamBufferGenericCreate( xBufferSizeBytes, ( size_t ) 0, pdTRUE )
|
#define xMessageBufferCreate( xBufferSizeBytes ) \
|
||||||
|
( MessageBufferHandle_t ) xStreamBufferGenericCreate( xBufferSizeBytes, ( size_t ) 0, pdTRUE )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -205,7 +207,8 @@
|
||||||
* \defgroup xMessageBufferCreateStatic xMessageBufferCreateStatic
|
* \defgroup xMessageBufferCreateStatic xMessageBufferCreateStatic
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferCreateStatic( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer ) ( MessageBufferHandle_t ) xStreamBufferGenericCreateStatic( xBufferSizeBytes, 0, pdTRUE, pucMessageBufferStorageArea, pxStaticMessageBuffer )
|
#define xMessageBufferCreateStatic( xBufferSizeBytes, pucMessageBufferStorageArea, pxStaticMessageBuffer ) \
|
||||||
|
( MessageBufferHandle_t ) xStreamBufferGenericCreateStatic( xBufferSizeBytes, 0, pdTRUE, pucMessageBufferStorageArea, pxStaticMessageBuffer )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -215,7 +218,7 @@
|
||||||
* const void *pvTxData,
|
* const void *pvTxData,
|
||||||
* size_t xDataLengthBytes,
|
* size_t xDataLengthBytes,
|
||||||
* TickType_t xTicksToWait );
|
* TickType_t xTicksToWait );
|
||||||
* <pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Sends a discrete message to the message buffer. The message can be any
|
* Sends a discrete message to the message buffer. The message can be any
|
||||||
* length that fits within the buffer's free space, and is copied into the
|
* length that fits within the buffer's free space, and is copied into the
|
||||||
|
@ -304,7 +307,8 @@
|
||||||
* \defgroup xMessageBufferSend xMessageBufferSend
|
* \defgroup xMessageBufferSend xMessageBufferSend
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferSend( xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait ) xStreamBufferSend( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait )
|
#define xMessageBufferSend( xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait ) \
|
||||||
|
xStreamBufferSend( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, xTicksToWait )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -314,7 +318,7 @@
|
||||||
* const void *pvTxData,
|
* const void *pvTxData,
|
||||||
* size_t xDataLengthBytes,
|
* size_t xDataLengthBytes,
|
||||||
* BaseType_t *pxHigherPriorityTaskWoken );
|
* BaseType_t *pxHigherPriorityTaskWoken );
|
||||||
* <pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Interrupt safe version of the API function that sends a discrete message to
|
* Interrupt safe version of the API function that sends a discrete message to
|
||||||
* the message buffer. The message can be any length that fits within the
|
* the message buffer. The message can be any length that fits within the
|
||||||
|
@ -408,7 +412,8 @@
|
||||||
* \defgroup xMessageBufferSendFromISR xMessageBufferSendFromISR
|
* \defgroup xMessageBufferSendFromISR xMessageBufferSendFromISR
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferSendFromISR( xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken ) xStreamBufferSendFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken )
|
#define xMessageBufferSendFromISR( xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken ) \
|
||||||
|
xStreamBufferSendFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -496,7 +501,8 @@
|
||||||
* \defgroup xMessageBufferReceive xMessageBufferReceive
|
* \defgroup xMessageBufferReceive xMessageBufferReceive
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferReceive( xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait ) xStreamBufferReceive( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait )
|
#define xMessageBufferReceive( xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait ) \
|
||||||
|
xStreamBufferReceive( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, xTicksToWait )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -597,7 +603,8 @@
|
||||||
* \defgroup xMessageBufferReceiveFromISR xMessageBufferReceiveFromISR
|
* \defgroup xMessageBufferReceiveFromISR xMessageBufferReceiveFromISR
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferReceiveFromISR( xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken ) xStreamBufferReceiveFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken )
|
#define xMessageBufferReceiveFromISR( xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken ) \
|
||||||
|
xStreamBufferReceiveFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -617,7 +624,8 @@
|
||||||
* @param xMessageBuffer The handle of the message buffer to be deleted.
|
* @param xMessageBuffer The handle of the message buffer to be deleted.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define vMessageBufferDelete( xMessageBuffer ) vStreamBufferDelete( ( StreamBufferHandle_t ) xMessageBuffer )
|
#define vMessageBufferDelete( xMessageBuffer ) \
|
||||||
|
vStreamBufferDelete( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -634,7 +642,8 @@
|
||||||
* @return If the message buffer referenced by xMessageBuffer is full then
|
* @return If the message buffer referenced by xMessageBuffer is full then
|
||||||
* pdTRUE is returned. Otherwise pdFALSE is returned.
|
* pdTRUE is returned. Otherwise pdFALSE is returned.
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferIsFull( xMessageBuffer ) xStreamBufferIsFull( ( StreamBufferHandle_t ) xMessageBuffer )
|
#define xMessageBufferIsFull( xMessageBuffer ) \
|
||||||
|
xStreamBufferIsFull( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -650,7 +659,8 @@
|
||||||
* pdTRUE is returned. Otherwise pdFALSE is returned.
|
* pdTRUE is returned. Otherwise pdFALSE is returned.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferIsEmpty( xMessageBuffer ) xStreamBufferIsEmpty( ( StreamBufferHandle_t ) xMessageBuffer )
|
#define xMessageBufferIsEmpty( xMessageBuffer ) \
|
||||||
|
xStreamBufferIsEmpty( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -673,7 +683,8 @@
|
||||||
* \defgroup xMessageBufferReset xMessageBufferReset
|
* \defgroup xMessageBufferReset xMessageBufferReset
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferReset( xMessageBuffer ) xStreamBufferReset( ( StreamBufferHandle_t ) xMessageBuffer )
|
#define xMessageBufferReset( xMessageBuffer ) \
|
||||||
|
xStreamBufferReset( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -695,8 +706,10 @@
|
||||||
* \defgroup xMessageBufferSpaceAvailable xMessageBufferSpaceAvailable
|
* \defgroup xMessageBufferSpaceAvailable xMessageBufferSpaceAvailable
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferSpaceAvailable( xMessageBuffer ) xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer )
|
#define xMessageBufferSpaceAvailable( xMessageBuffer ) \
|
||||||
#define xMessageBufferSpacesAvailable( xMessageBuffer ) xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer ) /* Corrects typo in original macro name. */
|
xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer )
|
||||||
|
#define xMessageBufferSpacesAvailable( xMessageBuffer ) \
|
||||||
|
xStreamBufferSpacesAvailable( ( StreamBufferHandle_t ) xMessageBuffer ) /* Corrects typo in original macro name. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -715,7 +728,8 @@
|
||||||
* \defgroup xMessageBufferNextLengthBytes xMessageBufferNextLengthBytes
|
* \defgroup xMessageBufferNextLengthBytes xMessageBufferNextLengthBytes
|
||||||
* \ingroup MessageBufferManagement
|
* \ingroup MessageBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferNextLengthBytes( xMessageBuffer ) xStreamBufferNextMessageLengthBytes( ( StreamBufferHandle_t ) xMessageBuffer ) PRIVILEGED_FUNCTION;
|
#define xMessageBufferNextLengthBytes( xMessageBuffer ) \
|
||||||
|
xStreamBufferNextMessageLengthBytes( ( StreamBufferHandle_t ) xMessageBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -754,7 +768,8 @@
|
||||||
* \defgroup xMessageBufferSendCompletedFromISR xMessageBufferSendCompletedFromISR
|
* \defgroup xMessageBufferSendCompletedFromISR xMessageBufferSendCompletedFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferSendCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) xStreamBufferSendCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
#define xMessageBufferSendCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
|
||||||
|
xStreamBufferSendCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* message_buffer.h
|
* message_buffer.h
|
||||||
|
@ -794,10 +809,13 @@
|
||||||
* \defgroup xMessageBufferReceiveCompletedFromISR xMessageBufferReceiveCompletedFromISR
|
* \defgroup xMessageBufferReceiveCompletedFromISR xMessageBufferReceiveCompletedFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xMessageBufferReceiveCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) xStreamBufferReceiveCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
#define xMessageBufferReceiveCompletedFromISR( xMessageBuffer, pxHigherPriorityTaskWoken ) \
|
||||||
|
xStreamBufferReceiveCompletedFromISR( ( StreamBufferHandle_t ) xMessageBuffer, pxHigherPriorityTaskWoken )
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( __cplusplus )
|
#if defined( __cplusplus )
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* !defined( FREERTOS_MESSAGE_BUFFER_H ) */
|
#endif /* !defined( FREERTOS_MESSAGE_BUFFER_H ) */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MPU_WRAPPERS_H
|
#ifndef MPU_WRAPPERS_H
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
@ -92,9 +91,11 @@
|
||||||
#define portARCH_NAME NULL
|
#define portARCH_NAME NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#include "mpu_wrappers.h"
|
#include "mpu_wrappers.h"
|
||||||
|
|
||||||
|
@ -206,8 +207,10 @@
|
||||||
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* PORTABLE_H */
|
#endif /* PORTABLE_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PROJDEFS_H
|
#ifndef PROJDEFS_H
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -33,9 +32,11 @@
|
||||||
#error "include FreeRTOS.h" must appear in source files before "include queue.h"
|
#error "include FreeRTOS.h" must appear in source files before "include queue.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
|
@ -96,7 +97,7 @@
|
||||||
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
||||||
* be created without using any dynamic memory allocation.
|
* be created without using any dynamic memory allocation.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
* https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
||||||
*
|
*
|
||||||
* @param uxQueueLength The maximum number of items that the queue can contain.
|
* @param uxQueueLength The maximum number of items that the queue can contain.
|
||||||
*
|
*
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
|
||||||
* be created without using any dynamic memory allocation.
|
* be created without using any dynamic memory allocation.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
* https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
|
||||||
*
|
*
|
||||||
* @param uxQueueLength The maximum number of items that the queue can contain.
|
* @param uxQueueLength The maximum number of items that the queue can contain.
|
||||||
*
|
*
|
||||||
|
@ -310,7 +311,8 @@
|
||||||
* \defgroup xQueueSend xQueueSend
|
* \defgroup xQueueSend xQueueSend
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
|
#define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) \
|
||||||
|
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -392,7 +394,8 @@
|
||||||
* \defgroup xQueueSend xQueueSend
|
* \defgroup xQueueSend xQueueSend
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
|
#define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) \
|
||||||
|
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -476,7 +479,8 @@
|
||||||
* \defgroup xQueueSend xQueueSend
|
* \defgroup xQueueSend xQueueSend
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
|
#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) \
|
||||||
|
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -559,7 +563,8 @@
|
||||||
* \defgroup xQueueOverwrite xQueueOverwrite
|
* \defgroup xQueueOverwrite xQueueOverwrite
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueOverwrite( xQueue, pvItemToQueue ) xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE )
|
#define xQueueOverwrite( xQueue, pvItemToQueue ) \
|
||||||
|
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -659,7 +664,8 @@
|
||||||
* QueueHandle_t xQueue,
|
* QueueHandle_t xQueue,
|
||||||
* void * const pvBuffer,
|
* void * const pvBuffer,
|
||||||
* TickType_t xTicksToWait
|
* TickType_t xTicksToWait
|
||||||
* );</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Receive an item from a queue without removing the item from the queue.
|
* Receive an item from a queue without removing the item from the queue.
|
||||||
* The item is received by copy so a buffer of adequate size must be
|
* The item is received by copy so a buffer of adequate size must be
|
||||||
|
@ -754,7 +760,8 @@
|
||||||
* BaseType_t xQueuePeekFromISR(
|
* BaseType_t xQueuePeekFromISR(
|
||||||
* QueueHandle_t xQueue,
|
* QueueHandle_t xQueue,
|
||||||
* void *pvBuffer,
|
* void *pvBuffer,
|
||||||
* );</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* A version of xQueuePeek() that can be called from an interrupt service
|
* A version of xQueuePeek() that can be called from an interrupt service
|
||||||
* routine (ISR).
|
* routine (ISR).
|
||||||
|
@ -789,7 +796,8 @@
|
||||||
* QueueHandle_t xQueue,
|
* QueueHandle_t xQueue,
|
||||||
* void *pvBuffer,
|
* void *pvBuffer,
|
||||||
* TickType_t xTicksToWait
|
* TickType_t xTicksToWait
|
||||||
* );</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Receive an item from a queue. The item is received by copy so a buffer of
|
* Receive an item from a queue. The item is received by copy so a buffer of
|
||||||
* adequate size must be provided. The number of bytes copied into the buffer
|
* adequate size must be provided. The number of bytes copied into the buffer
|
||||||
|
@ -877,7 +885,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
* <pre>UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );</pre>
|
* <pre>
|
||||||
|
* UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Return the number of messages stored in a queue.
|
* Return the number of messages stored in a queue.
|
||||||
*
|
*
|
||||||
|
@ -892,7 +902,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
* <pre>UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );</pre>
|
* <pre>
|
||||||
|
* UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Return the number of free spaces available in a queue. This is equal to the
|
* Return the number of free spaces available in a queue. This is equal to the
|
||||||
* number of items that can be sent to the queue before the queue becomes full
|
* number of items that can be sent to the queue before the queue becomes full
|
||||||
|
@ -909,7 +921,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
* <pre>void vQueueDelete( QueueHandle_t xQueue );</pre>
|
* <pre>
|
||||||
|
* void vQueueDelete( QueueHandle_t xQueue );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Delete a queue - freeing all the memory allocated for storing of items
|
* Delete a queue - freeing all the memory allocated for storing of items
|
||||||
* placed on the queue.
|
* placed on the queue.
|
||||||
|
@ -989,7 +1003,8 @@
|
||||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
|
#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
|
||||||
|
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1060,7 +1075,8 @@
|
||||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
|
#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
|
||||||
|
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -1147,7 +1163,8 @@
|
||||||
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
|
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE )
|
#define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
|
||||||
|
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -1221,7 +1238,8 @@
|
||||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
|
#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
|
||||||
|
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -1689,8 +1707,10 @@
|
||||||
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* QUEUE_H */
|
#endif /* QUEUE_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SEMAPHORE_H
|
#ifndef SEMAPHORE_H
|
||||||
|
@ -43,7 +42,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>vSemaphoreCreateBinary( SemaphoreHandle_t xSemaphore )</pre>
|
* <pre>
|
||||||
|
* vSemaphoreCreateBinary( SemaphoreHandle_t xSemaphore );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* In many usage scenarios it is faster and more memory efficient to use a
|
* In many usage scenarios it is faster and more memory efficient to use a
|
||||||
* direct to task notification in place of a binary semaphore!
|
* direct to task notification in place of a binary semaphore!
|
||||||
|
@ -103,7 +104,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateBinary( void )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateBinary( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new binary semaphore instance, and returns a handle by which the
|
* Creates a new binary semaphore instance, and returns a handle by which the
|
||||||
* new semaphore can be referenced.
|
* new semaphore can be referenced.
|
||||||
|
@ -164,7 +167,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t *pxSemaphoreBuffer )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t *pxSemaphoreBuffer );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new binary semaphore instance, and returns a handle by which the
|
* Creates a new binary semaphore instance, and returns a handle by which the
|
||||||
* new semaphore can be referenced.
|
* new semaphore can be referenced.
|
||||||
|
@ -223,10 +228,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>xSemaphoreTake(
|
* <pre>
|
||||||
|
* xSemaphoreTake(
|
||||||
* SemaphoreHandle_t xSemaphore,
|
* SemaphoreHandle_t xSemaphore,
|
||||||
* TickType_t xBlockTime
|
* TickType_t xBlockTime
|
||||||
* )</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* <i>Macro</i> to obtain a semaphore. The semaphore must have previously been
|
* <i>Macro</i> to obtain a semaphore. The semaphore must have previously been
|
||||||
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
||||||
|
@ -290,10 +297,12 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
|
* <pre>
|
||||||
* xSemaphoreTakeRecursive(
|
* xSemaphoreTakeRecursive(
|
||||||
* SemaphoreHandle_t xMutex,
|
* SemaphoreHandle_t xMutex,
|
||||||
* TickType_t xBlockTime
|
* TickType_t xBlockTime
|
||||||
* )
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* <i>Macro</i> to recursively obtain, or 'take', a mutex type semaphore.
|
* <i>Macro</i> to recursively obtain, or 'take', a mutex type semaphore.
|
||||||
* The mutex must have previously been created using a call to
|
* The mutex must have previously been created using a call to
|
||||||
|
@ -385,7 +394,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>xSemaphoreGive( SemaphoreHandle_t xSemaphore )</pre>
|
* <pre>
|
||||||
|
* xSemaphoreGive( SemaphoreHandle_t xSemaphore );
|
||||||
|
* </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
|
||||||
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
* created with a call to xSemaphoreCreateBinary(), xSemaphoreCreateMutex() or
|
||||||
|
@ -448,7 +459,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex )</pre>
|
* <pre>
|
||||||
|
* xSemaphoreGiveRecursive( SemaphoreHandle_t xMutex );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.
|
* <i>Macro</i> to recursively release, or 'give', a mutex type semaphore.
|
||||||
* The mutex must have previously been created using a call to
|
* The mutex must have previously been created using a call to
|
||||||
|
@ -538,7 +551,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* xSemaphoreGiveFromISR(
|
* xSemaphoreGiveFromISR(
|
||||||
* SemaphoreHandle_t xSemaphore,
|
* SemaphoreHandle_t xSemaphore,
|
||||||
* BaseType_t *pxHigherPriorityTaskWoken
|
* BaseType_t *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
|
||||||
* created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting().
|
* created with a call to xSemaphoreCreateBinary() or xSemaphoreCreateCounting().
|
||||||
|
@ -629,7 +643,8 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
* xSemaphoreTakeFromISR(
|
* xSemaphoreTakeFromISR(
|
||||||
* SemaphoreHandle_t xSemaphore,
|
* SemaphoreHandle_t xSemaphore,
|
||||||
* BaseType_t *pxHigherPriorityTaskWoken
|
* BaseType_t *pxHigherPriorityTaskWoken
|
||||||
* )</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* <i>Macro</i> to take a semaphore from an ISR. The semaphore must have
|
* <i>Macro</i> to take a semaphore from an ISR. The semaphore must have
|
||||||
* previously been created with a call to xSemaphoreCreateBinary() or
|
* previously been created with a call to xSemaphoreCreateBinary() or
|
||||||
|
@ -659,7 +674,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateMutex( void )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateMutex( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new mutex type semaphore instance, and returns a handle by which
|
* Creates a new mutex type semaphore instance, and returns a handle by which
|
||||||
* the new mutex can be referenced.
|
* the new mutex can be referenced.
|
||||||
|
@ -718,7 +735,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateMutexStatic( StaticSemaphore_t *pxMutexBuffer )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateMutexStatic( StaticSemaphore_t *pxMutexBuffer );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new mutex type semaphore instance, and returns a handle by which
|
* Creates a new mutex type semaphore instance, and returns a handle by which
|
||||||
* the new mutex can be referenced.
|
* the new mutex can be referenced.
|
||||||
|
@ -780,7 +799,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateRecursiveMutex( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
||||||
* by which the new recursive mutex can be referenced.
|
* by which the new recursive mutex can be referenced.
|
||||||
|
@ -847,7 +868,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic( StaticSemaphore_t *pxMutexBuffer )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateRecursiveMutexStatic( StaticSemaphore_t *pxMutexBuffer );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
* Creates a new recursive mutex type semaphore instance, and returns a handle
|
||||||
* by which the new recursive mutex can be referenced.
|
* by which the new recursive mutex can be referenced.
|
||||||
|
@ -920,7 +943,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateCounting( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||||
* new counting semaphore can be referenced.
|
* new counting semaphore can be referenced.
|
||||||
|
@ -1000,7 +1025,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer )</pre>
|
* <pre>
|
||||||
|
* SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t uxMaxCount, UBaseType_t uxInitialCount, StaticSemaphore_t *pxSemaphoreBuffer );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Creates a new counting semaphore instance, and returns a handle by which the
|
* Creates a new counting semaphore instance, and returns a handle by which the
|
||||||
* new counting semaphore can be referenced.
|
* new counting semaphore can be referenced.
|
||||||
|
@ -1085,7 +1112,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr. h
|
* semphr. h
|
||||||
* <pre>void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );</pre>
|
* <pre>
|
||||||
|
* void vSemaphoreDelete( SemaphoreHandle_t xSemaphore );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Delete a semaphore. This function must be used with care. For example,
|
* Delete a semaphore. This function must be used with care. For example,
|
||||||
* do not delete a mutex type semaphore if the mutex is held by a task.
|
* do not delete a mutex type semaphore if the mutex is held by a task.
|
||||||
|
@ -1099,7 +1128,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr.h
|
* semphr.h
|
||||||
* <pre>TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );</pre>
|
* <pre>
|
||||||
|
* TaskHandle_t xSemaphoreGetMutexHolder( SemaphoreHandle_t xMutex );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
||||||
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||||
|
@ -1114,7 +1145,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr.h
|
* semphr.h
|
||||||
* <pre>TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );</pre>
|
* <pre>
|
||||||
|
* TaskHandle_t xSemaphoreGetMutexHolderFromISR( SemaphoreHandle_t xMutex );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
* If xMutex is indeed a mutex type semaphore, return the current mutex holder.
|
||||||
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
* If xMutex is not a mutex type semaphore, or the mutex is available (not held
|
||||||
|
@ -1125,7 +1158,9 @@ typedef QueueHandle_t SemaphoreHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* semphr.h
|
* semphr.h
|
||||||
* <pre>UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );</pre>
|
* <pre>
|
||||||
|
* UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t xSemaphore );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns
|
* If the semaphore is a counting semaphore then uxSemaphoreGetCount() returns
|
||||||
* its current count value. If the semaphore is a binary semaphore then
|
* its current count value. If the semaphore is a binary semaphore then
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STACK_MACROS_H
|
#ifndef STACK_MACROS_H
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -55,9 +54,11 @@
|
||||||
#error "include FreeRTOS.h must appear in source files before include stream_buffer.h"
|
#error "include FreeRTOS.h must appear in source files before include stream_buffer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( __cplusplus )
|
#if defined( __cplusplus )
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type by which stream buffers are referenced. For example, a call to
|
* Type by which stream buffers are referenced. For example, a call to
|
||||||
|
@ -215,7 +216,8 @@
|
||||||
* \defgroup xStreamBufferCreateStatic xStreamBufferCreateStatic
|
* \defgroup xStreamBufferCreateStatic xStreamBufferCreateStatic
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, pucStreamBufferStorageArea, pxStaticStreamBuffer )
|
#define xStreamBufferCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pucStreamBufferStorageArea, pxStaticStreamBuffer ) \
|
||||||
|
xStreamBufferGenericCreateStatic( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE, pucStreamBufferStorageArea, pxStaticStreamBuffer )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -856,8 +858,10 @@
|
||||||
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if defined( __cplusplus )
|
#if defined( __cplusplus )
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* !defined( STREAM_BUFFER_H ) */
|
#endif /* !defined( STREAM_BUFFER_H ) */
|
||||||
|
|
274
include/task.h
274
include/task.h
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,9 +34,11 @@
|
||||||
|
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* MACROS AND DEFINITIONS
|
* MACROS AND DEFINITIONS
|
||||||
|
@ -251,7 +252,8 @@
|
||||||
* void *pvParameters,
|
* void *pvParameters,
|
||||||
* UBaseType_t uxPriority,
|
* UBaseType_t uxPriority,
|
||||||
* TaskHandle_t *pvCreatedTask
|
* TaskHandle_t *pvCreatedTask
|
||||||
* );</pre>
|
* );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Create a new task and add it to the list of tasks that are ready to run.
|
* Create a new task and add it to the list of tasks that are ready to run.
|
||||||
*
|
*
|
||||||
|
@ -352,7 +354,8 @@
|
||||||
* void *pvParameters,
|
* void *pvParameters,
|
||||||
* UBaseType_t uxPriority,
|
* UBaseType_t uxPriority,
|
||||||
* StackType_t *pxStackBuffer,
|
* StackType_t *pxStackBuffer,
|
||||||
* StaticTask_t *pxTaskBuffer );</pre>
|
* StaticTask_t *pxTaskBuffer );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Create a new task and add it to the list of tasks that are ready to run.
|
* Create a new task and add it to the list of tasks that are ready to run.
|
||||||
*
|
*
|
||||||
|
@ -463,7 +466,8 @@
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* BaseType_t xTaskCreateRestricted( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );</pre>
|
* BaseType_t xTaskCreateRestricted( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Only available when configSUPPORT_DYNAMIC_ALLOCATION is set to 1.
|
* Only available when configSUPPORT_DYNAMIC_ALLOCATION is set to 1.
|
||||||
*
|
*
|
||||||
|
@ -540,7 +544,8 @@
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* BaseType_t xTaskCreateRestrictedStatic( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );</pre>
|
* BaseType_t xTaskCreateRestrictedStatic( TaskParameters_t *pxTaskDefinition, TaskHandle_t *pxCreatedTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Only available when configSUPPORT_STATIC_ALLOCATION is set to 1.
|
* Only available when configSUPPORT_STATIC_ALLOCATION is set to 1.
|
||||||
*
|
*
|
||||||
|
@ -629,7 +634,8 @@
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );</pre>
|
* void vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Memory regions are assigned to a restricted task when the task is created by
|
* Memory regions are assigned to a restricted task when the task is created by
|
||||||
* a call to xTaskCreateRestricted(). These regions can be redefined using
|
* a call to xTaskCreateRestricted(). These regions can be redefined using
|
||||||
|
@ -677,7 +683,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskDelete( TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* void vTaskDelete( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_vTaskDelete must be defined as 1 for this function to be available.
|
* INCLUDE_vTaskDelete must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -722,7 +730,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskDelay( const TickType_t xTicksToDelay );</pre>
|
* <pre>
|
||||||
|
* void vTaskDelay( const TickType_t xTicksToDelay );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Delay a task for a given number of ticks. The actual time that the
|
* Delay a task for a given number of ticks. The actual time that the
|
||||||
* task remains blocked depends on the tick rate. The constant
|
* task remains blocked depends on the tick rate. The constant
|
||||||
|
@ -770,7 +780,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );</pre>
|
* <pre>
|
||||||
|
* void vTaskDelayUntil( TickType_t *pxPreviousWakeTime, const TickType_t xTimeIncrement );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available.
|
* INCLUDE_vTaskDelayUntil must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -830,7 +842,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>BaseType_t xTaskAbortDelay( TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* BaseType_t xTaskAbortDelay( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_xTaskAbortDelay must be defined as 1 in FreeRTOSConfig.h for this
|
* INCLUDE_xTaskAbortDelay must be defined as 1 in FreeRTOSConfig.h for this
|
||||||
* function to be available.
|
* function to be available.
|
||||||
|
@ -860,7 +874,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* UBaseType_t uxTaskPriorityGet( const TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available.
|
* INCLUDE_uxTaskPriorityGet must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -907,7 +923,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* UBaseType_t uxTaskPriorityGetFromISR( const TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* A version of uxTaskPriorityGet() that can be used from an ISR.
|
* A version of uxTaskPriorityGet() that can be used from an ISR.
|
||||||
*/
|
*/
|
||||||
|
@ -915,7 +933,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>eTaskState eTaskGetState( TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* eTaskState eTaskGetState( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_eTaskGetState must be defined as 1 for this function to be available.
|
* INCLUDE_eTaskGetState must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -933,7 +953,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );</pre>
|
* <pre>
|
||||||
|
* void vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* configUSE_TRACE_FACILITY must be defined as 1 for this function to be
|
* configUSE_TRACE_FACILITY must be defined as 1 for this function to be
|
||||||
* available. See the configuration section for more information.
|
* available. See the configuration section for more information.
|
||||||
|
@ -992,7 +1014,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );</pre>
|
* <pre>
|
||||||
|
* void vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.
|
* INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -1035,7 +1059,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskSuspend( TaskHandle_t xTaskToSuspend );</pre>
|
* <pre>
|
||||||
|
* void vTaskSuspend( TaskHandle_t xTaskToSuspend );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
|
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -1086,7 +1112,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskResume( TaskHandle_t xTaskToResume );</pre>
|
* <pre>
|
||||||
|
* void vTaskResume( TaskHandle_t xTaskToResume );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
|
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.
|
||||||
* See the configuration section for more information.
|
* See the configuration section for more information.
|
||||||
|
@ -1135,7 +1163,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void xTaskResumeFromISR( TaskHandle_t xTaskToResume );</pre>
|
* <pre>
|
||||||
|
* void xTaskResumeFromISR( TaskHandle_t xTaskToResume );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be
|
* INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be
|
||||||
* available. See the configuration section for more information.
|
* available. See the configuration section for more information.
|
||||||
|
@ -1168,7 +1198,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskStartScheduler( void );</pre>
|
* <pre>
|
||||||
|
* void vTaskStartScheduler( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Starts the real time kernel tick processing. After calling the kernel
|
* Starts the real time kernel tick processing. After calling the kernel
|
||||||
* has control over which tasks are executed and when.
|
* has control over which tasks are executed and when.
|
||||||
|
@ -1197,7 +1229,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskEndScheduler( void );</pre>
|
* <pre>
|
||||||
|
* void vTaskEndScheduler( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* NOTE: At the time of writing only the x86 real mode port, which runs on a PC
|
* NOTE: At the time of writing only the x86 real mode port, which runs on a PC
|
||||||
* in place of DOS, implements this function.
|
* in place of DOS, implements this function.
|
||||||
|
@ -1253,7 +1287,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>void vTaskSuspendAll( void );</pre>
|
* <pre>
|
||||||
|
* void vTaskSuspendAll( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Suspends the scheduler without disabling interrupts. Context switches will
|
* Suspends the scheduler without disabling interrupts. Context switches will
|
||||||
* not occur while the scheduler is suspended.
|
* not occur while the scheduler is suspended.
|
||||||
|
@ -1304,7 +1340,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <pre>BaseType_t xTaskResumeAll( void );</pre>
|
* <pre>
|
||||||
|
* BaseType_t xTaskResumeAll( void );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Resumes scheduler activity after it was suspended by a call to
|
* Resumes scheduler activity after it was suspended by a call to
|
||||||
* vTaskSuspendAll().
|
* vTaskSuspendAll().
|
||||||
|
@ -1495,7 +1533,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );</pre>
|
* <pre>
|
||||||
|
* void vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Sets pxHookFunction to be the task hook function used by the task xTask.
|
* Sets pxHookFunction to be the task hook function used by the task xTask.
|
||||||
* Passing xTask as NULL has the effect of setting the calling tasks hook
|
* Passing xTask as NULL has the effect of setting the calling tasks hook
|
||||||
|
@ -1506,7 +1546,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>void xTaskGetApplicationTaskTag( TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* void xTaskGetApplicationTaskTag( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Returns the pxHookFunction value assigned to the task xTask. Do not
|
* Returns the pxHookFunction value assigned to the task xTask. Do not
|
||||||
* call from an interrupt service routine - call
|
* call from an interrupt service routine - call
|
||||||
|
@ -1516,7 +1558,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>void xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask );</pre>
|
* <pre>
|
||||||
|
* void xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Returns the pxHookFunction value assigned to the task xTask. Can
|
* Returns the pxHookFunction value assigned to the task xTask. Can
|
||||||
* be called from an interrupt service routine.
|
* be called from an interrupt service routine.
|
||||||
|
@ -1540,9 +1584,57 @@
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );</pre>
|
* <pre>void vApplicationStackOverflowHook( TaskHandle_t xTask char *pcTaskName); </pre>
|
||||||
|
*
|
||||||
|
* The application stack overflow hook is called when a stack overflow is detected for a task.
|
||||||
|
*
|
||||||
|
* Details on stack overflow detection can be found here: https://www.freertos.org/Stacks-and-stack-overflow-checking.html
|
||||||
|
*
|
||||||
|
* @param xTask the task that just exceeded its stack boundaries.
|
||||||
|
* @param pcTaskName A character string containing the name of the offending task.
|
||||||
|
*/
|
||||||
|
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||||
|
char * pcTaskName );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ( configUSE_TICK_HOOK > 0 )
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>void vApplicationTickHook( void ); </pre>
|
||||||
|
*
|
||||||
|
* This hook function is called in the system tick handler after any OS work is completed.
|
||||||
|
*/
|
||||||
|
void vApplicationTickHook( void ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer, StackType_t ** ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) </pre>
|
||||||
|
*
|
||||||
|
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Idle Task TCB. This function is required when
|
||||||
|
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||||
|
*
|
||||||
|
* @param ppxIdleTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||||
|
* @param ppxIdleTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
|
||||||
|
* @param pulIdleTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||||
|
*/
|
||||||
|
void vApplicationGetIdleTaskMemory( StaticTask_t ** ppxIdleTaskTCBBuffer,
|
||||||
|
StackType_t ** ppxIdleTaskStackBuffer,
|
||||||
|
uint32_t * pulIdleTaskStackSize ); /*lint !e526 Symbol not defined as it is an application callback. */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>
|
||||||
|
* BaseType_t xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Calls the hook function associated with xTask. Passing xTask as NULL has
|
* Calls the hook function associated with xTask. Passing xTask as NULL has
|
||||||
* the effect of calling the Running tasks (the calling task) hook function.
|
* the effect of calling the Running tasks (the calling task) hook function.
|
||||||
|
@ -1800,7 +1892,7 @@
|
||||||
* <PRE>BaseType_t xTaskNotifyIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction );</PRE>
|
* <PRE>BaseType_t xTaskNotifyIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction );</PRE>
|
||||||
* <PRE>BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction );</PRE>
|
* <PRE>BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction );</PRE>
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
||||||
* functions to be available.
|
* functions to be available.
|
||||||
|
@ -1907,15 +1999,17 @@
|
||||||
uint32_t ulValue,
|
uint32_t ulValue,
|
||||||
eNotifyAction eAction,
|
eNotifyAction eAction,
|
||||||
uint32_t * pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
|
uint32_t * pulPreviousNotificationValue ) PRIVILEGED_FUNCTION;
|
||||||
#define xTaskNotify( xTaskToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL )
|
#define xTaskNotify( xTaskToNotify, ulValue, eAction ) \
|
||||||
#define xTaskNotifyIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction ) xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL )
|
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL )
|
||||||
|
#define xTaskNotifyIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction ) \
|
||||||
|
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>BaseType_t xTaskNotifyAndQueryIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );</PRE>
|
* <PRE>BaseType_t xTaskNotifyAndQueryIndexed( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );</PRE>
|
||||||
* <PRE>BaseType_t xTaskNotifyAndQuery( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );</PRE>
|
* <PRE>BaseType_t xTaskNotifyAndQuery( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotifyValue );</PRE>
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* xTaskNotifyAndQueryIndexed() performs the same operation as
|
* xTaskNotifyAndQueryIndexed() performs the same operation as
|
||||||
* xTaskNotifyIndexed() with the addition that it also returns the subject
|
* xTaskNotifyIndexed() with the addition that it also returns the subject
|
||||||
|
@ -1932,15 +2026,17 @@
|
||||||
* \defgroup xTaskNotifyAndQueryIndexed xTaskNotifyAndQueryIndexed
|
* \defgroup xTaskNotifyAndQueryIndexed xTaskNotifyAndQueryIndexed
|
||||||
* \ingroup TaskNotifications
|
* \ingroup TaskNotifications
|
||||||
*/
|
*/
|
||||||
#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
|
#define xTaskNotifyAndQuery( xTaskToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
|
||||||
#define xTaskNotifyAndQueryIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotifyValue ) xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
|
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
|
||||||
|
#define xTaskNotifyAndQueryIndexed( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotifyValue ) \
|
||||||
|
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotifyValue ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>BaseType_t xTaskNotifyIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
* <PRE>BaseType_t xTaskNotifyIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
* <PRE>BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
* <PRE>BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
||||||
* functions to be available.
|
* functions to be available.
|
||||||
|
@ -2052,15 +2148,17 @@
|
||||||
eNotifyAction eAction,
|
eNotifyAction eAction,
|
||||||
uint32_t * pulPreviousNotificationValue,
|
uint32_t * pulPreviousNotificationValue,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
#define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
|
#define xTaskNotifyFromISR( xTaskToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
|
||||||
#define xTaskNotifyIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
|
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
|
||||||
|
#define xTaskNotifyIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), NULL, ( pxHigherPriorityTaskWoken ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>BaseType_t xTaskNotifyAndQueryIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
* <PRE>BaseType_t xTaskNotifyAndQueryIndexedFromISR( TaskHandle_t xTaskToNotify, UBaseType_t uxIndexToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
* <PRE>BaseType_t xTaskNotifyAndQueryFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
* <PRE>BaseType_t xTaskNotifyAndQueryFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* xTaskNotifyAndQueryIndexedFromISR() performs the same operation as
|
* xTaskNotifyAndQueryIndexedFromISR() performs the same operation as
|
||||||
* xTaskNotifyIndexedFromISR() with the addition that it also returns the
|
* xTaskNotifyIndexedFromISR() with the addition that it also returns the
|
||||||
|
@ -2077,18 +2175,23 @@
|
||||||
* \defgroup xTaskNotifyAndQueryIndexedFromISR xTaskNotifyAndQueryIndexedFromISR
|
* \defgroup xTaskNotifyAndQueryIndexedFromISR xTaskNotifyAndQueryIndexedFromISR
|
||||||
* \ingroup TaskNotifications
|
* \ingroup TaskNotifications
|
||||||
*/
|
*/
|
||||||
#define xTaskNotifyAndQueryIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
|
#define xTaskNotifyAndQueryIndexedFromISR( xTaskToNotify, uxIndexToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
|
||||||
#define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
|
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
|
||||||
|
#define xTaskNotifyAndQueryFromISR( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTaskGenericNotifyFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulValue ), ( eAction ), ( pulPreviousNotificationValue ), ( pxHigherPriorityTaskWoken ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>BaseType_t xTaskNotifyWaitIndexed( UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );</pre>
|
* <pre>
|
||||||
* <PRE>BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );</pre>
|
* BaseType_t xTaskNotifyWaitIndexed( UBaseType_t uxIndexToWaitOn, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
|
||||||
|
*
|
||||||
|
* BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Waits for a direct to task notification to be pending at a given index within
|
* Waits for a direct to task notification to be pending at a given index within
|
||||||
* an array of direct to task notifications.
|
* an array of direct to task notifications.
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
|
||||||
* function to be available.
|
* function to be available.
|
||||||
|
@ -2186,8 +2289,10 @@
|
||||||
uint32_t ulBitsToClearOnExit,
|
uint32_t ulBitsToClearOnExit,
|
||||||
uint32_t * pulNotificationValue,
|
uint32_t * pulNotificationValue,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
#define xTaskNotifyWait( ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
|
#define xTaskNotifyWait( ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
|
||||||
#define xTaskNotifyWaitIndexed( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) xTaskGenericNotifyWait( ( uxIndexToWaitOn ), ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
|
xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
|
||||||
|
#define xTaskNotifyWaitIndexed( uxIndexToWaitOn, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ) \
|
||||||
|
xTaskGenericNotifyWait( ( uxIndexToWaitOn ), ( ulBitsToClearOnEntry ), ( ulBitsToClearOnExit ), ( pulNotificationValue ), ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
|
@ -2197,7 +2302,7 @@
|
||||||
* Sends a direct to task notification to a particular index in the target
|
* Sends a direct to task notification to a particular index in the target
|
||||||
* task's notification array in a manner similar to giving a counting semaphore.
|
* task's notification array in a manner similar to giving a counting semaphore.
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
||||||
* macros to be available.
|
* macros to be available.
|
||||||
|
@ -2259,18 +2364,20 @@
|
||||||
* \defgroup xTaskNotifyGiveIndexed xTaskNotifyGiveIndexed
|
* \defgroup xTaskNotifyGiveIndexed xTaskNotifyGiveIndexed
|
||||||
* \ingroup TaskNotifications
|
* \ingroup TaskNotifications
|
||||||
*/
|
*/
|
||||||
#define xTaskNotifyGive( xTaskToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( 0 ), eIncrement, NULL )
|
#define xTaskNotifyGive( xTaskToNotify ) \
|
||||||
#define xTaskNotifyGiveIndexed( xTaskToNotify, uxIndexToNotify ) xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( 0 ), eIncrement, NULL )
|
xTaskGenericNotify( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( 0 ), eIncrement, NULL )
|
||||||
|
#define xTaskNotifyGiveIndexed( xTaskToNotify, uxIndexToNotify ) \
|
||||||
|
xTaskGenericNotify( ( xTaskToNotify ), ( uxIndexToNotify ), ( 0 ), eIncrement, NULL )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>void vTaskNotifyGiveIndexedFromISR( TaskHandle_t xTaskHandle, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken );
|
* <PRE>void vTaskNotifyGiveIndexedFromISR( TaskHandle_t xTaskHandle, UBaseType_t uxIndexToNotify, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
* <PRE>void vTaskNotifyGiveFromISR( TaskHandle_t xTaskHandle, BaseType_t *pxHigherPriorityTaskWoken );
|
* <PRE>void vTaskNotifyGiveFromISR( TaskHandle_t xTaskHandle, BaseType_t *pxHigherPriorityTaskWoken );</PRE>
|
||||||
*
|
*
|
||||||
* A version of xTaskNotifyGiveIndexed() that can be called from an interrupt
|
* A version of xTaskNotifyGiveIndexed() that can be called from an interrupt
|
||||||
* service routine (ISR).
|
* service routine (ISR).
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for more details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this macro
|
||||||
* to be available.
|
* to be available.
|
||||||
|
@ -2342,18 +2449,23 @@
|
||||||
void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify,
|
void vTaskGenericNotifyGiveFromISR( TaskHandle_t xTaskToNotify,
|
||||||
UBaseType_t uxIndexToNotify,
|
UBaseType_t uxIndexToNotify,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
#define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) );
|
#define vTaskNotifyGiveFromISR( xTaskToNotify, pxHigherPriorityTaskWoken ) \
|
||||||
#define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) );
|
vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( pxHigherPriorityTaskWoken ) );
|
||||||
|
#define vTaskNotifyGiveIndexedFromISR( xTaskToNotify, uxIndexToNotify, pxHigherPriorityTaskWoken ) \
|
||||||
|
vTaskGenericNotifyGiveFromISR( ( xTaskToNotify ), ( uxIndexToNotify ), ( pxHigherPriorityTaskWoken ) );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>uint32_t ulTaskNotifyTakeIndexed( UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait );</pre>
|
* <pre>
|
||||||
* <PRE>uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );</pre>
|
* uint32_t ulTaskNotifyTakeIndexed( UBaseType_t uxIndexToWaitOn, BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
|
||||||
|
*
|
||||||
|
* uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Waits for a direct to task notification on a particular index in the calling
|
* Waits for a direct to task notification on a particular index in the calling
|
||||||
* task's notification array in a manner similar to taking a counting semaphore.
|
* task's notification array in a manner similar to taking a counting semaphore.
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for this
|
||||||
* function to be available.
|
* function to be available.
|
||||||
|
@ -2443,15 +2555,20 @@
|
||||||
uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
||||||
BaseType_t xClearCountOnExit,
|
BaseType_t xClearCountOnExit,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
#define ulTaskNotifyTake( xClearCountOnExit, xTicksToWait ) ulTaskGenericNotifyTake( ( tskDEFAULT_INDEX_TO_NOTIFY ), ( xClearCountOnExit ), ( xTicksToWait ) )
|
#define ulTaskNotifyTake( xClearCountOnExit, xTicksToWait ) \
|
||||||
#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait ) ulTaskGenericNotifyTake( ( uxIndexToNotify ), ( xClearCountOnExit ), ( xTicksToWait ) )
|
ulTaskGenericNotifyTake( ( tskDEFAULT_INDEX_TO_NOTIFY ), ( xClearCountOnExit ), ( xTicksToWait ) )
|
||||||
|
#define ulTaskNotifyTakeIndexed( uxIndexToWaitOn, xClearCountOnExit, xTicksToWait ) \
|
||||||
|
ulTaskGenericNotifyTake( ( uxIndexToNotify ), ( xClearCountOnExit ), ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>BaseType_t xTaskNotifyStateClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToCLear );</pre>
|
* <pre>
|
||||||
* <PRE>BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );</pre>
|
* BaseType_t xTaskNotifyStateClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToCLear );
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* BaseType_t xTaskNotifyStateClear( TaskHandle_t xTask );
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
||||||
* functions to be available.
|
* functions to be available.
|
||||||
|
@ -2502,15 +2619,20 @@
|
||||||
*/
|
*/
|
||||||
BaseType_t xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
BaseType_t xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
||||||
UBaseType_t uxIndexToClear ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxIndexToClear ) PRIVILEGED_FUNCTION;
|
||||||
#define xTaskNotifyStateClear( xTask ) xTaskGenericNotifyStateClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ) )
|
#define xTaskNotifyStateClear( xTask ) \
|
||||||
#define xTaskNotifyStateClearIndexed( xTask, uxIndexToClear ) xTaskGenericNotifyStateClear( ( xTask ), ( uxIndexToClear ) )
|
xTaskGenericNotifyStateClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ) )
|
||||||
|
#define xTaskNotifyStateClearIndexed( xTask, uxIndexToClear ) \
|
||||||
|
xTaskGenericNotifyStateClear( ( xTask ), ( uxIndexToClear ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task. h
|
* task. h
|
||||||
* <PRE>uint32_t ulTaskNotifyValueClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear );</pre>
|
* <pre>
|
||||||
* <PRE>uint32_t ulTaskNotifyValueClear( TaskHandle_t xTask, uint32_t ulBitsToClear );</pre>
|
* uint32_t ulTaskNotifyValueClearIndexed( TaskHandle_t xTask, UBaseType_t uxIndexToClear, uint32_t ulBitsToClear );
|
||||||
*
|
*
|
||||||
* See http://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
* uint32_t ulTaskNotifyValueClear( TaskHandle_t xTask, uint32_t ulBitsToClear );
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* See https://www.FreeRTOS.org/RTOS-task-notifications.html for details.
|
||||||
*
|
*
|
||||||
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
* configUSE_TASK_NOTIFICATIONS must be undefined or defined as 1 for these
|
||||||
* functions to be available.
|
* functions to be available.
|
||||||
|
@ -2563,12 +2685,16 @@
|
||||||
uint32_t ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
uint32_t ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
||||||
UBaseType_t uxIndexToClear,
|
UBaseType_t uxIndexToClear,
|
||||||
uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
||||||
#define ulTaskNotifyValueClear( xTask, ulBitsToClear ) ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )
|
#define ulTaskNotifyValueClear( xTask, ulBitsToClear ) \
|
||||||
#define ulTaskNotifyValueClearIndexed( xTask, uxIndexToClear, ulBitsToClear ) ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )
|
ulTaskGenericNotifyValueClear( ( xTask ), ( tskDEFAULT_INDEX_TO_NOTIFY ), ( ulBitsToClear ) )
|
||||||
|
#define ulTaskNotifyValueClearIndexed( xTask, uxIndexToClear, ulBitsToClear ) \
|
||||||
|
ulTaskGenericNotifyValueClear( ( xTask ), ( uxIndexToClear ), ( ulBitsToClear ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )</pre>
|
* <pre>
|
||||||
|
* void vTaskSetTimeOutState( TimeOut_t * const pxTimeOut );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Capture the current time for future use with xTaskCheckForTimeOut().
|
* Capture the current time for future use with xTaskCheckForTimeOut().
|
||||||
*
|
*
|
||||||
|
@ -2582,7 +2708,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );</pre>
|
* <pre>
|
||||||
|
* BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* Determines if pxTicksToWait ticks has passed since a time was captured
|
* Determines if pxTicksToWait ticks has passed since a time was captured
|
||||||
* using a call to vTaskSetTimeOutState(). The captured time includes the tick
|
* using a call to vTaskSetTimeOutState(). The captured time includes the tick
|
||||||
|
@ -2666,7 +2794,9 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* task.h
|
* task.h
|
||||||
* <pre>BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp );</pre>
|
* <pre>
|
||||||
|
* BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp );
|
||||||
|
* </pre>
|
||||||
*
|
*
|
||||||
* This function corrects the tick count value after the application code has held
|
* This function corrects the tick count value after the application code has held
|
||||||
* interrupts disabled for an extended period resulting in tick interrupts having
|
* interrupts disabled for an extended period resulting in tick interrupts having
|
||||||
|
@ -2899,7 +3029,9 @@
|
||||||
void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
|
void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
#endif /* INC_TASK_H */
|
#endif /* INC_TASK_H */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,9 +37,11 @@
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
/*lint -restore */
|
/*lint -restore */
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* MACROS AND DEFINITIONS
|
* MACROS AND DEFINITIONS
|
||||||
|
@ -503,7 +504,8 @@
|
||||||
* See the xTimerCreate() API function example usage scenario.
|
* See the xTimerCreate() API function example usage scenario.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define xTimerStart( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
|
#define xTimerStart( xTimer, xTicksToWait ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerStop( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
* BaseType_t xTimerStop( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
||||||
|
@ -545,7 +547,8 @@
|
||||||
* See the xTimerCreate() API function example usage scenario.
|
* See the xTimerCreate() API function example usage scenario.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define xTimerStop( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) )
|
#define xTimerStop( xTimer, xTicksToWait ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0U, NULL, ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerChangePeriod( TimerHandle_t xTimer,
|
* BaseType_t xTimerChangePeriod( TimerHandle_t xTimer,
|
||||||
|
@ -625,7 +628,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) )
|
#define xTimerChangePeriod( xTimer, xNewPeriod, xTicksToWait ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), NULL, ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
* BaseType_t xTimerDelete( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
||||||
|
@ -663,7 +667,8 @@
|
||||||
*
|
*
|
||||||
* See the xTimerChangePeriod() API function example usage scenario.
|
* See the xTimerChangePeriod() API function example usage scenario.
|
||||||
*/
|
*/
|
||||||
#define xTimerDelete( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )
|
#define xTimerDelete( xTimer, xTicksToWait ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_DELETE, 0U, NULL, ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerReset( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
* BaseType_t xTimerReset( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
||||||
|
@ -787,7 +792,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerReset( xTimer, xTicksToWait ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
|
#define xTimerReset( xTimer, xTicksToWait ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xTicksToWait ) )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerStartFromISR( TimerHandle_t xTimer,
|
* BaseType_t xTimerStartFromISR( TimerHandle_t xTimer,
|
||||||
|
@ -873,7 +879,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
|
#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerStopFromISR( TimerHandle_t xTimer,
|
* BaseType_t xTimerStopFromISR( TimerHandle_t xTimer,
|
||||||
|
@ -936,7 +943,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )
|
#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,
|
* BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,
|
||||||
|
@ -1009,7 +1017,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )
|
#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerResetFromISR( TimerHandle_t xTimer,
|
* BaseType_t xTimerResetFromISR( TimerHandle_t xTimer,
|
||||||
|
@ -1095,7 +1104,8 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
|
#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) \
|
||||||
|
xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1314,7 +1324,28 @@
|
||||||
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
|
|
||||||
|
/**
|
||||||
|
* task.h
|
||||||
|
* <pre>void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer, StackType_t ** ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize ) </pre>
|
||||||
|
*
|
||||||
|
* This function is used to provide a statically allocated block of memory to FreeRTOS to hold the Timer Task TCB. This function is required when
|
||||||
|
* configSUPPORT_STATIC_ALLOCATION is set. For more information see this URI: https://www.freertos.org/a00110.html#configSUPPORT_STATIC_ALLOCATION
|
||||||
|
*
|
||||||
|
* @param ppxTimerTaskTCBBuffer A handle to a statically allocated TCB buffer
|
||||||
|
* @param ppxTimerTaskStackBuffer A handle to a statically allocated Stack buffer for thie idle task
|
||||||
|
* @param pulTimerTaskStackSize A pointer to the number of elements that will fit in the allocated stack buffer
|
||||||
|
*/
|
||||||
|
void vApplicationGetTimerTaskMemory( StaticTask_t ** ppxTimerTaskTCBBuffer,
|
||||||
|
StackType_t ** ppxTimerTaskStackBuffer,
|
||||||
|
uint32_t * pulTimerTaskStackSize );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
#endif /* TIMERS_H */
|
#endif /* TIMERS_H */
|
||||||
|
|
17
list.c
17
list.c
|
@ -19,17 +19,28 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <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
|
||||||
|
* task.h is included from an application file. */
|
||||||
|
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||||
|
|
||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
|
/* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified
|
||||||
|
* because the MPU ports require MPU_WRAPPERS_INCLUDED_FROM_API_FILE to be
|
||||||
|
* defined for the header files above, but not in this file, in order to
|
||||||
|
* generate the correct privileged Vs unprivileged linkage and placement. */
|
||||||
|
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021. */
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* PUBLIC LIST API documented in list.h
|
* PUBLIC LIST API documented in list.h
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
# * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
# * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
# *
|
# *
|
||||||
# * http://www.FreeRTOS.org
|
# * https://www.FreeRTOS.org
|
||||||
# * http://aws.amazon.com/freertos
|
# * https://github.com/FreeRTOS
|
||||||
# *
|
# *
|
||||||
# * 1 tab == 4 spaces!
|
# * 1 tab == 4 spaces!
|
||||||
# */
|
# */
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
||||||
|
@ -74,7 +73,7 @@
|
||||||
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
||||||
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
||||||
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
||||||
#define portNVIC_SYSPRI2_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
||||||
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
||||||
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
||||||
#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
|
#define portNVIC_SYSTICK_COUNT_FLAG_BIT ( 1UL << 16UL )
|
||||||
|
@ -350,7 +349,7 @@ portDONT_DISCARD void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) PRIV
|
||||||
* @brief Each task maintains its own interrupt status in the critical nesting
|
* @brief Each task maintains its own interrupt status in the critical nesting
|
||||||
* variable.
|
* variable.
|
||||||
*/
|
*/
|
||||||
static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
PRIVILEGED_DATA static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
|
|
||||||
#if ( configENABLE_TRUSTZONE == 1 )
|
#if ( configENABLE_TRUSTZONE == 1 )
|
||||||
|
|
||||||
|
@ -358,7 +357,7 @@ static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
* @brief Saved as part of the task context to indicate which context the
|
* @brief Saved as part of the task context to indicate which context the
|
||||||
* task is using on the secure side.
|
* task is using on the secure side.
|
||||||
*/
|
*/
|
||||||
portDONT_DISCARD volatile SecureContextHandle_t xSecureContext = portNO_SECURE_CONTEXT;
|
PRIVILEGED_DATA portDONT_DISCARD volatile SecureContextHandle_t xSecureContext = portNO_SECURE_CONTEXT;
|
||||||
#endif /* configENABLE_TRUSTZONE */
|
#endif /* configENABLE_TRUSTZONE */
|
||||||
|
|
||||||
#if ( configUSE_TICKLESS_IDLE == 1 )
|
#if ( configUSE_TICKLESS_IDLE == 1 )
|
||||||
|
@ -366,19 +365,19 @@ static volatile uint32_t ulCriticalNesting = 0xaaaaaaaaUL;
|
||||||
/**
|
/**
|
||||||
* @brief The number of SysTick increments that make up one tick period.
|
* @brief The number of SysTick increments that make up one tick period.
|
||||||
*/
|
*/
|
||||||
static uint32_t ulTimerCountsForOneTick = 0;
|
PRIVILEGED_DATA static uint32_t ulTimerCountsForOneTick = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The maximum number of tick periods that can be suppressed is
|
* @brief The maximum number of tick periods that can be suppressed is
|
||||||
* limited by the 24 bit resolution of the SysTick timer.
|
* limited by the 24 bit resolution of the SysTick timer.
|
||||||
*/
|
*/
|
||||||
static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
PRIVILEGED_DATA static uint32_t xMaximumPossibleSuppressedTicks = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
* @brief Compensate for the CPU cycles that pass while the SysTick is
|
||||||
* stopped (low power functionality only).
|
* stopped (low power functionality only).
|
||||||
*/
|
*/
|
||||||
static uint32_t ulStoppedTimerCompensation = 0;
|
PRIVILEGED_DATA static uint32_t ulStoppedTimerCompensation = 0;
|
||||||
#endif /* configUSE_TICKLESS_IDLE */
|
#endif /* configUSE_TICKLESS_IDLE */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -567,7 +566,7 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
|
||||||
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;
|
||||||
|
|
||||||
/* Configure SysTick to interrupt at the requested rate. */
|
/* Configure SysTick to interrupt at the requested rate. */
|
||||||
portNVIC_SYSTICK_LOAD_REG = ( configCPU_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
|
portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;
|
||||||
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
|
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -876,7 +875,7 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
/* *INDENT-OFF* */
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
StackType_t * pxEndOfStack,
|
StackType_t * pxEndOfStack,
|
||||||
|
@ -889,6 +888,7 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters ) /* PRIVILEGED_FUNCTION */
|
void * pvParameters ) /* PRIVILEGED_FUNCTION */
|
||||||
#endif /* configENABLE_MPU */
|
#endif /* configENABLE_MPU */
|
||||||
|
/* *INDENT-ON* */
|
||||||
{
|
{
|
||||||
/* 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. */
|
||||||
|
@ -1001,8 +1001,8 @@ void vPortSVCHandler_C( uint32_t * pulCallerStackAddress ) /* PRIVILEGED_FUNCTIO
|
||||||
BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
|
BaseType_t xPortStartScheduler( void ) /* PRIVILEGED_FUNCTION */
|
||||||
{
|
{
|
||||||
/* Make PendSV, CallSV and SysTick the same priority as the kernel. */
|
/* Make PendSV, CallSV and SysTick the same priority as the kernel. */
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_PENDSV_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_SYSTICK_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
|
||||||
|
|
||||||
#if ( configENABLE_MPU == 1 )
|
#if ( configENABLE_MPU == 1 )
|
||||||
{
|
{
|
||||||
|
@ -1052,6 +1052,18 @@ void vPortEndScheduler( void ) /* PRIVILEGED_FUNCTION */
|
||||||
uint32_t ulRegionStartAddress, ulRegionEndAddress, ulRegionNumber;
|
uint32_t ulRegionStartAddress, ulRegionEndAddress, ulRegionNumber;
|
||||||
int32_t lIndex = 0;
|
int32_t lIndex = 0;
|
||||||
|
|
||||||
|
#if defined( __ARMCC_VERSION )
|
||||||
|
|
||||||
|
/* Declaration when these variable are defined in code instead of being
|
||||||
|
* exported from linker scripts. */
|
||||||
|
extern uint32_t * __privileged_sram_start__;
|
||||||
|
extern uint32_t * __privileged_sram_end__;
|
||||||
|
#else
|
||||||
|
/* Declaration when these variable are exported from linker scripts. */
|
||||||
|
extern uint32_t __privileged_sram_start__[];
|
||||||
|
extern uint32_t __privileged_sram_end__[];
|
||||||
|
#endif /* defined( __ARMCC_VERSION ) */
|
||||||
|
|
||||||
/* Setup MAIR0. */
|
/* Setup MAIR0. */
|
||||||
xMPUSettings->ulMAIR0 = ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
xMPUSettings->ulMAIR0 = ( ( portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE << portMPU_MAIR_ATTR0_POS ) & portMPU_MAIR_ATTR0_MASK );
|
||||||
xMPUSettings->ulMAIR0 |= ( ( portMPU_DEVICE_MEMORY_nGnRE << portMPU_MAIR_ATTR1_POS ) & portMPU_MAIR_ATTR1_MASK );
|
xMPUSettings->ulMAIR0 |= ( ( portMPU_DEVICE_MEMORY_nGnRE << portMPU_MAIR_ATTR1_POS ) & portMPU_MAIR_ATTR1_MASK );
|
||||||
|
@ -1062,9 +1074,23 @@ void vPortEndScheduler( void ) /* PRIVILEGED_FUNCTION */
|
||||||
* the stack region has already been configured. */
|
* the stack region has already been configured. */
|
||||||
if( ulStackDepth > 0 )
|
if( ulStackDepth > 0 )
|
||||||
{
|
{
|
||||||
/* Define the region that allows access to the stack. */
|
ulRegionStartAddress = ( uint32_t ) pxBottomOfStack;
|
||||||
ulRegionStartAddress = ( ( uint32_t ) pxBottomOfStack ) & portMPU_RBAR_ADDRESS_MASK;
|
|
||||||
ulRegionEndAddress = ( uint32_t ) pxBottomOfStack + ( ulStackDepth * ( uint32_t ) sizeof( StackType_t ) ) - 1;
|
ulRegionEndAddress = ( uint32_t ) pxBottomOfStack + ( ulStackDepth * ( uint32_t ) sizeof( StackType_t ) ) - 1;
|
||||||
|
|
||||||
|
/* If the stack is within the privileged SRAM, do not protect it
|
||||||
|
* using a separate MPU region. This is needed because privileged
|
||||||
|
* SRAM is already protected using an MPU region and ARMv8-M does
|
||||||
|
* not allow overlapping MPU regions. */
|
||||||
|
if( ( ulRegionStartAddress >= ( uint32_t ) __privileged_sram_start__ ) &&
|
||||||
|
( ulRegionEndAddress <= ( uint32_t ) __privileged_sram_end__ ) )
|
||||||
|
{
|
||||||
|
xMPUSettings->xRegionsSettings[ 0 ].ulRBAR = 0;
|
||||||
|
xMPUSettings->xRegionsSettings[ 0 ].ulRLAR = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Define the region that allows access to the stack. */
|
||||||
|
ulRegionStartAddress &= portMPU_RBAR_ADDRESS_MASK;
|
||||||
ulRegionEndAddress &= portMPU_RLAR_ADDRESS_MASK;
|
ulRegionEndAddress &= portMPU_RLAR_ADDRESS_MASK;
|
||||||
|
|
||||||
xMPUSettings->xRegionsSettings[ 0 ].ulRBAR = ( ulRegionStartAddress ) |
|
xMPUSettings->xRegionsSettings[ 0 ].ulRBAR = ( ulRegionStartAddress ) |
|
||||||
|
@ -1076,6 +1102,7 @@ void vPortEndScheduler( void ) /* PRIVILEGED_FUNCTION */
|
||||||
( portMPU_RLAR_ATTR_INDEX0 ) |
|
( portMPU_RLAR_ATTR_INDEX0 ) |
|
||||||
( portMPU_RLAR_REGION_ENABLE );
|
( portMPU_RLAR_REGION_ENABLE );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* User supplied configurable regions. */
|
/* User supplied configurable regions. */
|
||||||
for( ulRegionNumber = 1; ulRegionNumber <= portNUM_CONFIGURABLE_REGIONS; ulRegionNumber++ )
|
for( ulRegionNumber = 1; ulRegionNumber <= portNUM_CONFIGURABLE_REGIONS; ulRegionNumber++ )
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,23 +19,23 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V1.00:
|
Changes from V1.00:
|
||||||
*
|
|
||||||
+ Call to taskYIELD() from within tick ISR has been replaced by the more
|
+ Call to taskYIELD() from within tick ISR has been replaced by the more
|
||||||
+ efficient portSWITCH_CONTEXT().
|
efficient portSWITCH_CONTEXT().
|
||||||
+ ISR function definitions renamed to include the prv prefix.
|
+ ISR function definitions renamed to include the prv prefix.
|
||||||
+
|
|
||||||
+ Changes from V2.6.1
|
Changes from V2.6.1
|
||||||
+
|
|
||||||
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
|
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
|
||||||
+ macro to be consistent with the later ports.
|
macro to be consistent with the later ports.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
@ -68,16 +68,14 @@ static void prvSetTickFrequency( uint32_t ulTickRateHz );
|
||||||
static void prvExitFunction( void );
|
static void prvExitFunction( void );
|
||||||
|
|
||||||
/* The ISR used depends on whether the preemptive or cooperative scheduler
|
/* The ISR used depends on whether the preemptive or cooperative scheduler
|
||||||
* is being used. */
|
is being used. */
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
|
|
||||||
/* Tick service routine used by the scheduler when preemptive scheduling is
|
/* Tick service routine used by the scheduler when preemptive scheduling is
|
||||||
* being used. */
|
being used. */
|
||||||
static void __interrupt __far prvPreemptiveTick( void );
|
static void __interrupt __far prvPreemptiveTick( void );
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Tick service routine used by the scheduler when cooperative scheduling is
|
/* Tick service routine used by the scheduler when cooperative scheduling is
|
||||||
* being used. */
|
being used. */
|
||||||
static void __interrupt __far prvNonPreemptiveTick( void );
|
static void __interrupt __far prvNonPreemptiveTick( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -90,8 +88,8 @@ static void __interrupt __far prvYieldProcessor( void );
|
||||||
static BaseType_t xSchedulerRunning = pdFALSE;
|
static BaseType_t xSchedulerRunning = pdFALSE;
|
||||||
|
|
||||||
/* Points to the original routine installed on the vector we use for manual
|
/* Points to the original routine installed on the vector we use for manual
|
||||||
* context switches. This is then used to restore the original routine during
|
context switches. This is then used to restore the original routine during
|
||||||
* prvExitFunction(). */
|
prvExitFunction(). */
|
||||||
static void ( __interrupt __far *pxOldSwitchISR )();
|
static void ( __interrupt __far *pxOldSwitchISR )();
|
||||||
|
|
||||||
/* Used to restore the original DOS context when the scheduler is ended. */
|
/* Used to restore the original DOS context when the scheduler is ended. */
|
||||||
|
@ -105,11 +103,11 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/* This is called with interrupts already disabled. */
|
/* This is called with interrupts already disabled. */
|
||||||
|
|
||||||
/* Remember what was on the interrupts we are going to use
|
/* Remember what was on the interrupts we are going to use
|
||||||
* so we can put them back later if required. */
|
so we can put them back later if required. */
|
||||||
pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
|
pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
|
||||||
|
|
||||||
/* Put our manual switch (yield) function on a known
|
/* Put our manual switch (yield) function on a known
|
||||||
* vector. */
|
vector. */
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
|
_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
|
||||||
|
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
|
@ -145,7 +143,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* The ISR used depends on whether the preemptive or cooperative scheduler
|
/* The ISR used depends on whether the preemptive or cooperative scheduler
|
||||||
* is being used. */
|
is being used. */
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
static void __interrupt __far prvPreemptiveTick( void )
|
static void __interrupt __far prvPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -159,15 +157,15 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/* Reset the PIC ready for the next time. */
|
/* Reset the PIC ready for the next time. */
|
||||||
portRESET_PIC();
|
portRESET_PIC();
|
||||||
}
|
}
|
||||||
#else /* if ( configUSE_PREEMPTION == 1 ) */
|
#else
|
||||||
static void __interrupt __far prvNonPreemptiveTick( void )
|
static void __interrupt __far prvNonPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
/* Same as preemptive tick, but the cooperative scheduler is being used
|
/* Same as preemptive tick, but the cooperative scheduler is being used
|
||||||
* so we don't have to switch in the context of the next task. */
|
so we don't have to switch in the context of the next task. */
|
||||||
xTaskIncrementTick();
|
xTaskIncrementTick();
|
||||||
portRESET_PIC();
|
portRESET_PIC();
|
||||||
}
|
}
|
||||||
#endif /* if ( configUSE_PREEMPTION == 1 ) */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void __interrupt __far prvYieldProcessor( void )
|
static void __interrupt __far prvYieldProcessor( void )
|
||||||
|
@ -180,8 +178,8 @@ static void __interrupt __far prvYieldProcessor( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* Jump back to the processor state prior to starting the
|
/* Jump back to the processor state prior to starting the
|
||||||
* scheduler. This means we are not going to be using a
|
scheduler. This means we are not going to be using a
|
||||||
* task stack frame so the task can be deleted. */
|
task stack frame so the task can be deleted. */
|
||||||
longjmp( xJumpBuf, 1 );
|
longjmp( xJumpBuf, 1 );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -192,19 +190,18 @@ static void prvExitFunction( void )
|
||||||
uint16_t usTimer0Control;
|
uint16_t usTimer0Control;
|
||||||
|
|
||||||
/* Interrupts should be disabled here anyway - but no
|
/* Interrupts should be disabled here anyway - but no
|
||||||
* harm in making sure. */
|
harm in making sure. */
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
if( xSchedulerRunning == pdTRUE )
|
if( xSchedulerRunning == pdTRUE )
|
||||||
{
|
{
|
||||||
/* Put back the switch interrupt routines that was in place
|
/* Put back the switch interrupt routines that was in place
|
||||||
* before the scheduler started. */
|
before the scheduler started. */
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
|
_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Disable the timer used for the tick to ensure the scheduler is
|
/* Disable the timer used for the tick to ensure the scheduler is
|
||||||
* not called before restoring interrupts. There was previously nothing
|
not called before restoring interrupts. There was previously nothing
|
||||||
* on this timer so there is no old ISR to restore. */
|
on this timer so there is no old ISR to restore. */
|
||||||
portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerDisable );
|
portOUTPUT_WORD( portTIMER_1_CONTROL_REGISTER, usTimerDisable );
|
||||||
|
|
||||||
/* Restart the DOS tick. */
|
/* Restart the DOS tick. */
|
||||||
|
@ -244,3 +241,4 @@ static void prvSetTickFrequency( uint32_t ulTickRateHz )
|
||||||
|
|
||||||
|
|
||||||
/*lint +e950 */
|
/*lint +e950 */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -61,8 +61,7 @@ typedef unsigned short UBaseType_t;
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section handling. */
|
/* Critical section handling. */
|
||||||
#define portENTER_CRITICAL() \
|
#define portENTER_CRITICAL() __asm{ pushf } \
|
||||||
__asm{ pushf } \
|
|
||||||
__asm{ cli } \
|
__asm{ cli } \
|
||||||
|
|
||||||
#define portEXIT_CRITICAL() __asm{ popf }
|
#define portEXIT_CRITICAL() __asm{ popf }
|
||||||
|
@ -95,3 +94,4 @@ typedef unsigned short UBaseType_t;
|
||||||
#define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
|
#define portTASK_FUNCTION( vTaskFunction, vParameters ) void vTaskFunction( void *pvParameters )
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,22 +19,22 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V2.6.1
|
Changes from V2.6.1
|
||||||
*
|
|
||||||
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
|
+ Replaced the sUsingPreemption variable with the configUSE_PREEMPTION
|
||||||
+ macro to be consistent with the later ports.
|
macro to be consistent with the later ports.
|
||||||
+
|
|
||||||
+ Changes from V4.0.1
|
Changes from V4.0.1
|
||||||
+
|
|
||||||
+ Add function prvSetTickFrequencyDefault() to set the DOS tick back to
|
+ Add function prvSetTickFrequencyDefault() to set the DOS tick back to
|
||||||
+ its proper value when the scheduler exits.
|
its proper value when the scheduler exits.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -61,21 +61,19 @@ static void prvSetTickFrequency( uint32_t ulTickRateHz );
|
||||||
static void prvExitFunction( void );
|
static void prvExitFunction( void );
|
||||||
|
|
||||||
/* Either chain to the DOS tick (which itself clears the PIC) or clear the PIC
|
/* Either chain to the DOS tick (which itself clears the PIC) or clear the PIC
|
||||||
* directly. We chain to the DOS tick as close as possible to the standard DOS
|
directly. We chain to the DOS tick as close as possible to the standard DOS
|
||||||
* tick rate. */
|
tick rate. */
|
||||||
static void prvPortResetPIC( void );
|
static void prvPortResetPIC( void );
|
||||||
|
|
||||||
/* The ISR used depends on whether the preemptive or cooperative
|
/* The ISR used depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
|
|
||||||
/* Tick service routine used by the scheduler when preemptive scheduling is
|
/* Tick service routine used by the scheduler when preemptive scheduling is
|
||||||
* being used. */
|
being used. */
|
||||||
static void __interrupt __far prvPreemptiveTick( void );
|
static void __interrupt __far prvPreemptiveTick( void );
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Tick service routine used by the scheduler when cooperative scheduling is
|
/* Tick service routine used by the scheduler when cooperative scheduling is
|
||||||
* being used. */
|
being used. */
|
||||||
static void __interrupt __far prvNonPreemptiveTick( void );
|
static void __interrupt __far prvNonPreemptiveTick( void );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -83,7 +81,7 @@ static void prvPortResetPIC( void );
|
||||||
static void __interrupt __far prvYieldProcessor( void );
|
static void __interrupt __far prvYieldProcessor( void );
|
||||||
|
|
||||||
/* Set the tick frequency back so the floppy drive works correctly when the
|
/* Set the tick frequency back so the floppy drive works correctly when the
|
||||||
* scheduler exits. */
|
scheduler exits. */
|
||||||
static void prvSetTickFrequencyDefault( void );
|
static void prvSetTickFrequencyDefault( void );
|
||||||
|
|
||||||
/*lint -e956 File scopes necessary here. */
|
/*lint -e956 File scopes necessary here. */
|
||||||
|
@ -113,7 +111,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/* This is called with interrupts already disabled. */
|
/* This is called with interrupts already disabled. */
|
||||||
|
|
||||||
/* Remember what was on the interrupts we are going to use
|
/* Remember what was on the interrupts we are going to use
|
||||||
* so we can put them back later if required. */
|
so we can put them back later if required. */
|
||||||
pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
|
pxOldSwitchISR = _dos_getvect( portSWITCH_INT_NUMBER );
|
||||||
pxOriginalTickISR = _dos_getvect( portTIMER_INT_NUMBER );
|
pxOriginalTickISR = _dos_getvect( portTIMER_INT_NUMBER );
|
||||||
pxOldSwitchISRPlus1 = _dos_getvect( portSWITCH_INT_NUMBER + 1 );
|
pxOldSwitchISRPlus1 = _dos_getvect( portSWITCH_INT_NUMBER + 1 );
|
||||||
|
@ -121,15 +119,15 @@ BaseType_t xPortStartScheduler( void )
|
||||||
prvSetTickFrequency( configTICK_RATE_HZ );
|
prvSetTickFrequency( configTICK_RATE_HZ );
|
||||||
|
|
||||||
/* Put our manual switch (yield) function on a known
|
/* Put our manual switch (yield) function on a known
|
||||||
* vector. */
|
vector. */
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
|
_dos_setvect( portSWITCH_INT_NUMBER, prvYieldProcessor );
|
||||||
|
|
||||||
/* Put the old tick on a different interrupt number so we can
|
/* Put the old tick on a different interrupt number so we can
|
||||||
* call it when we want. */
|
call it when we want. */
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER + 1, pxOriginalTickISR );
|
_dos_setvect( portSWITCH_INT_NUMBER + 1, pxOriginalTickISR );
|
||||||
|
|
||||||
/* The ISR used depends on whether the preemptive or cooperative
|
/* The ISR used depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
{
|
{
|
||||||
/* Put our tick switch function on the timer interrupt. */
|
/* Put our tick switch function on the timer interrupt. */
|
||||||
|
@ -143,8 +141,8 @@ BaseType_t xPortStartScheduler( void )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setup a counter that is used to call the DOS interrupt as close
|
/* Setup a counter that is used to call the DOS interrupt as close
|
||||||
* to it's original frequency as can be achieved given our chosen tick
|
to it's original frequency as can be achieved given our chosen tick
|
||||||
* frequency. */
|
frequency. */
|
||||||
sDOSTickCounter = portTICKS_PER_DOS_TICK;
|
sDOSTickCounter = portTICKS_PER_DOS_TICK;
|
||||||
|
|
||||||
/* Clean up function if we want to return to DOS. */
|
/* Clean up function if we want to return to DOS. */
|
||||||
|
@ -166,7 +164,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* The ISR used depends on whether the preemptive or cooperative
|
/* The ISR used depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
#if( configUSE_PREEMPTION == 1 )
|
#if( configUSE_PREEMPTION == 1 )
|
||||||
static void __interrupt __far prvPreemptiveTick( void )
|
static void __interrupt __far prvPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -180,15 +178,15 @@ BaseType_t xPortStartScheduler( void )
|
||||||
/* Reset the PIC ready for the next time. */
|
/* Reset the PIC ready for the next time. */
|
||||||
prvPortResetPIC();
|
prvPortResetPIC();
|
||||||
}
|
}
|
||||||
#else /* if ( configUSE_PREEMPTION == 1 ) */
|
#else
|
||||||
static void __interrupt __far prvNonPreemptiveTick( void )
|
static void __interrupt __far prvNonPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
/* Same as preemptive tick, but the cooperative scheduler is being used
|
/* Same as preemptive tick, but the cooperative scheduler is being used
|
||||||
* so we don't have to switch in the context of the next task. */
|
so we don't have to switch in the context of the next task. */
|
||||||
xTaskIncrementTick();
|
xTaskIncrementTick();
|
||||||
prvPortResetPIC();
|
prvPortResetPIC();
|
||||||
}
|
}
|
||||||
#endif /* if ( configUSE_PREEMPTION == 1 ) */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
static void __interrupt __far prvYieldProcessor( void )
|
static void __interrupt __far prvYieldProcessor( void )
|
||||||
|
@ -201,22 +199,19 @@ static void __interrupt __far prvYieldProcessor( void )
|
||||||
static void prvPortResetPIC( void )
|
static void prvPortResetPIC( void )
|
||||||
{
|
{
|
||||||
/* We are going to call the DOS tick interrupt at as close a
|
/* We are going to call the DOS tick interrupt at as close a
|
||||||
* frequency to the normal DOS tick as possible. */
|
frequency to the normal DOS tick as possible. */
|
||||||
|
|
||||||
/* WE SHOULD NOT DO THIS IF YIELD WAS CALLED. */
|
/* WE SHOULD NOT DO THIS IF YIELD WAS CALLED. */
|
||||||
--sDOSTickCounter;
|
--sDOSTickCounter;
|
||||||
|
|
||||||
if( sDOSTickCounter <= 0 )
|
if( sDOSTickCounter <= 0 )
|
||||||
{
|
{
|
||||||
sDOSTickCounter = ( int16_t ) portTICKS_PER_DOS_TICK;
|
sDOSTickCounter = ( int16_t ) portTICKS_PER_DOS_TICK;
|
||||||
__asm {
|
__asm{ int portSWITCH_INT_NUMBER + 1 };
|
||||||
int portSWITCH_INT_NUMBER + 1
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Reset the PIC as the DOS tick is not being called to
|
/* Reset the PIC as the DOS tick is not being called to
|
||||||
* do it. */
|
do it. */
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
mov al, 20H
|
mov al, 20H
|
||||||
|
@ -229,8 +224,8 @@ static void prvPortResetPIC( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* Jump back to the processor state prior to starting the
|
/* Jump back to the processor state prior to starting the
|
||||||
* scheduler. This means we are not going to be using a
|
scheduler. This means we are not going to be using a
|
||||||
* task stack frame so the task can be deleted. */
|
task stack frame so the task can be deleted. */
|
||||||
longjmp( xJumpBuf, 1 );
|
longjmp( xJumpBuf, 1 );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -240,9 +235,8 @@ static void prvExitFunction( void )
|
||||||
void ( __interrupt __far *pxOriginalTickISR )();
|
void ( __interrupt __far *pxOriginalTickISR )();
|
||||||
|
|
||||||
/* Interrupts should be disabled here anyway - but no
|
/* Interrupts should be disabled here anyway - but no
|
||||||
* harm in making sure. */
|
harm in making sure. */
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
if( xSchedulerRunning == pdTRUE )
|
if( xSchedulerRunning == pdTRUE )
|
||||||
{
|
{
|
||||||
/* Set the DOS tick back onto the timer ticker. */
|
/* Set the DOS tick back onto the timer ticker. */
|
||||||
|
@ -251,13 +245,12 @@ static void prvExitFunction( void )
|
||||||
prvSetTickFrequencyDefault();
|
prvSetTickFrequencyDefault();
|
||||||
|
|
||||||
/* Put back the switch interrupt routines that was in place
|
/* Put back the switch interrupt routines that was in place
|
||||||
* before the scheduler started. */
|
before the scheduler started. */
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
|
_dos_setvect( portSWITCH_INT_NUMBER, pxOldSwitchISR );
|
||||||
_dos_setvect( portSWITCH_INT_NUMBER + 1, pxOldSwitchISRPlus1 );
|
_dos_setvect( portSWITCH_INT_NUMBER + 1, pxOldSwitchISRPlus1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The tick timer is back how DOS wants it. We can re-enable
|
/* The tick timer is back how DOS wants it. We can re-enable
|
||||||
* interrupts without the scheduler being called. */
|
interrupts without the scheduler being called. */
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -292,3 +285,4 @@ static void prvSetTickFrequencyDefault( void )
|
||||||
|
|
||||||
|
|
||||||
/*lint +e950 */
|
/*lint +e950 */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -61,8 +61,7 @@ typedef unsigned short UBaseType_t;
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Critical section management. */
|
/* Critical section management. */
|
||||||
#define portENTER_CRITICAL() \
|
#define portENTER_CRITICAL() __asm{ pushf } \
|
||||||
__asm{ pushf } \
|
|
||||||
__asm{ cli } \
|
__asm{ cli } \
|
||||||
|
|
||||||
#define portEXIT_CRITICAL() __asm{ popf }
|
#define portEXIT_CRITICAL() __asm{ popf }
|
||||||
|
@ -95,3 +94,4 @@ typedef unsigned short UBaseType_t;
|
||||||
#define portTASK_FUNCTION( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
|
#define portTASK_FUNCTION( vTaskFunction, pvParameters ) void vTaskFunction( void *pvParameters )
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -47,10 +47,10 @@ void portSWITCH_CONTEXT( void );
|
||||||
void portFIRST_CONTEXT( void );
|
void portFIRST_CONTEXT( void );
|
||||||
|
|
||||||
/* There are slightly different versions depending on whether you are building
|
/* There are slightly different versions depending on whether you are building
|
||||||
* to include debugger information. If debugger information is used then there
|
to include debugger information. If debugger information is used then there
|
||||||
* are a couple of extra bytes left of the ISR stack (presumably for use by the
|
are a couple of extra bytes left of the ISR stack (presumably for use by the
|
||||||
* debugger). The true stack pointer is then stored in the bp register. We add
|
debugger). The true stack pointer is then stored in the bp register. We add
|
||||||
* 2 to the stack pointer to remove the extra bytes before we restore our context. */
|
2 to the stack pointer to remove the extra bytes before we restore our context. */
|
||||||
|
|
||||||
#define portSWITCH_CONTEXT() \
|
#define portSWITCH_CONTEXT() \
|
||||||
asm { mov ax, seg pxCurrentTCB } \
|
asm { mov ax, seg pxCurrentTCB } \
|
||||||
|
@ -83,4 +83,5 @@ void portFIRST_CONTEXT( void );
|
||||||
__asm { iret }
|
__asm { iret }
|
||||||
|
|
||||||
|
|
||||||
#endif /* ifndef PORT_ASM_H */
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -19,21 +19,21 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V1.00:
|
Changes from V1.00:
|
||||||
*
|
|
||||||
+ pxPortInitialiseStack() now initialises the stack of new tasks to the
|
+ pxPortInitialiseStack() now initialises the stack of new tasks to the
|
||||||
+ same format used by the compiler. This allows the compiler generated
|
same format used by the compiler. This allows the compiler generated
|
||||||
+ interrupt mechanism to be used for context switches.
|
interrupt mechanism to be used for context switches.
|
||||||
+
|
|
||||||
+ Changes from V2.6.1
|
Changes from V2.6.1
|
||||||
+
|
|
||||||
+ Move usPortCheckFreeStackSpace() to tasks.c.
|
+ Move usPortCheckFreeStackSpace() to tasks.c.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -45,14 +45,12 @@
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* See header file for description. */
|
/* See header file for description. */
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t DS_Reg = 0;
|
StackType_t DS_Reg = 0;
|
||||||
|
|
||||||
/* Place a few bytes of known values on the bottom of the stack.
|
/* Place a few bytes of known values on the bottom of the stack.
|
||||||
* This is just useful for debugging. */
|
This is just useful for debugging. */
|
||||||
|
|
||||||
*pxTopOfStack = 0x1111;
|
*pxTopOfStack = 0x1111;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -69,8 +67,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
/*lint -e950 -e611 -e923 Lint doesn't like this much - but nothing I can do about it. */
|
/*lint -e950 -e611 -e923 Lint doesn't like this much - but nothing I can do about it. */
|
||||||
|
|
||||||
/* We are going to start the scheduler using a return from interrupt
|
/* We are going to start the scheduler using a return from interrupt
|
||||||
* instruction to load the program counter, so first there would be the
|
instruction to load the program counter, so first there would be the
|
||||||
* function call with parameters preamble. */
|
function call with parameters preamble. */
|
||||||
|
|
||||||
*pxTopOfStack = FP_SEG( pvParameters );
|
*pxTopOfStack = FP_SEG( pvParameters );
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -90,8 +88,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The remaining registers would be pushed on the stack by our context
|
/* The remaining registers would be pushed on the stack by our context
|
||||||
* switch function. These are loaded with values simply to make debugging
|
switch function. These are loaded with values simply to make debugging
|
||||||
* easier. */
|
easier. */
|
||||||
*pxTopOfStack = ( StackType_t ) 0xAAAA; /* AX */
|
*pxTopOfStack = ( StackType_t ) 0xAAAA; /* AX */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0xBBBB; /* BX */
|
*pxTopOfStack = ( StackType_t ) 0xBBBB; /* BX */
|
||||||
|
@ -104,9 +102,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* We need the true data segment. */
|
/* We need the true data segment. */
|
||||||
__asm {
|
__asm{ MOV DS_Reg, DS };
|
||||||
MOV DS_Reg, DS
|
|
||||||
};
|
|
||||||
|
|
||||||
*pxTopOfStack = DS_Reg; /* DS */
|
*pxTopOfStack = DS_Reg; /* DS */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -121,3 +117,4 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -19,14 +19,13 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* Implementation of functions defined in portable.h for the ARM CM4F port.
|
* Implementation of functions defined in portable.h for the ARM CM3 port.
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Scheduler includes. */
|
/* Scheduler includes. */
|
||||||
|
@ -52,7 +51,7 @@
|
||||||
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
||||||
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
||||||
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
||||||
#define portNVIC_SYSPRI2_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
||||||
/* ...then bits in the registers. */
|
/* ...then bits in the registers. */
|
||||||
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
||||||
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
@ -275,8 +274,8 @@ BaseType_t xPortStartScheduler( void )
|
||||||
#endif /* conifgASSERT_DEFINED */
|
#endif /* conifgASSERT_DEFINED */
|
||||||
|
|
||||||
/* Make PendSV and SysTick the lowest priority interrupts. */
|
/* Make PendSV and SysTick the lowest priority interrupts. */
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_PENDSV_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_SYSTICK_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
|
||||||
|
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
* here already. */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
; *
|
; *
|
||||||
; * http://www.FreeRTOS.org
|
; * https://www.FreeRTOS.org
|
||||||
; * http://aws.amazon.com/freertos
|
; * https://github.com/FreeRTOS
|
||||||
; *
|
; *
|
||||||
; * 1 tab == 4 spaces!
|
; * 1 tab == 4 spaces!
|
||||||
; */
|
; */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
|
@ -56,7 +55,7 @@
|
||||||
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
#define portNVIC_SYSTICK_CTRL_REG ( *( ( volatile uint32_t * ) 0xe000e010 ) )
|
||||||
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
#define portNVIC_SYSTICK_LOAD_REG ( *( ( volatile uint32_t * ) 0xe000e014 ) )
|
||||||
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
#define portNVIC_SYSTICK_CURRENT_VALUE_REG ( *( ( volatile uint32_t * ) 0xe000e018 ) )
|
||||||
#define portNVIC_SYSPRI2_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
#define portNVIC_SHPR3_REG ( *( ( volatile uint32_t * ) 0xe000ed20 ) )
|
||||||
/* ...then bits in the registers. */
|
/* ...then bits in the registers. */
|
||||||
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
#define portNVIC_SYSTICK_INT_BIT ( 1UL << 1UL )
|
||||||
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
#define portNVIC_SYSTICK_ENABLE_BIT ( 1UL << 0UL )
|
||||||
|
@ -294,8 +293,8 @@ BaseType_t xPortStartScheduler( void )
|
||||||
#endif /* conifgASSERT_DEFINED */
|
#endif /* conifgASSERT_DEFINED */
|
||||||
|
|
||||||
/* Make PendSV and SysTick the lowest priority interrupts. */
|
/* Make PendSV and SysTick the lowest priority interrupts. */
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_PENDSV_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_PENDSV_PRI;
|
||||||
portNVIC_SYSPRI2_REG |= portNVIC_SYSTICK_PRI;
|
portNVIC_SHPR3_REG |= portNVIC_SYSTICK_PRI;
|
||||||
|
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
* here already. */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
; *
|
; *
|
||||||
; * http://www.FreeRTOS.org
|
; * https://www.FreeRTOS.org
|
||||||
; * http://aws.amazon.com/freertos
|
; * https://github.com/FreeRTOS
|
||||||
; *
|
; *
|
||||||
; * 1 tab == 4 spaces!
|
; * 1 tab == 4 spaces!
|
||||||
; */
|
; */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +57,7 @@ uint32_t ulCriticalNesting = 9999;
|
||||||
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
|
#define portTHUMB_MODE_BIT ( ( StackType_t ) 0x20 )
|
||||||
|
|
||||||
/* The number of words on the stack frame between the saved Top Of Stack and
|
/* The number of words on the stack frame between the saved Top Of Stack and
|
||||||
* R0 (in which the parameters are passed. */
|
R0 (in which the parameters are passed. */
|
||||||
#define portSPACE_BETWEEN_TOS_AND_PARAMETERS ( 12 )
|
#define portSPACE_BETWEEN_TOS_AND_PARAMETERS ( 12 )
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -68,7 +68,7 @@ extern void vPortStartFirstTask( void );
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Saved as part of the task context. Set to pdFALSE if the task does not
|
/* Saved as part of the task context. Set to pdFALSE if the task does not
|
||||||
* require an FPU context. */
|
require an FPU context. */
|
||||||
uint32_t ulTaskHasFPUContext = 0;
|
uint32_t ulTaskHasFPUContext = 0;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -77,9 +77,7 @@ uint32_t ulTaskHasFPUContext = 0;
|
||||||
/*
|
/*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t *pxOriginalTOS;
|
StackType_t *pxOriginalTOS;
|
||||||
|
|
||||||
|
@ -93,11 +91,11 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First on the stack is the return address - which is the start of the as
|
/* First on the stack is the return address - which is the start of the as
|
||||||
* the task has not executed yet. The offset is added to make the return
|
the task has not executed yet. The offset is added to make the return
|
||||||
* address appear as it would within an IRQ ISR. */
|
address appear as it would within an IRQ ISR. */
|
||||||
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -133,11 +131,11 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
*pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
|
*pxTopOfStack = ( StackType_t ) 0x01010101; /* R1 */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
}
|
}
|
||||||
#else /* ifdef portPRELOAD_TASK_REGISTERS */
|
#else
|
||||||
{
|
{
|
||||||
pxTopOfStack -= portSPACE_BETWEEN_TOS_AND_PARAMETERS;
|
pxTopOfStack -= portSPACE_BETWEEN_TOS_AND_PARAMETERS;
|
||||||
}
|
}
|
||||||
#endif /* ifdef portPRELOAD_TASK_REGISTERS */
|
#endif
|
||||||
|
|
||||||
/* Function parameters are passed in R0. */
|
/* Function parameters are passed in R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
|
@ -157,8 +155,8 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The last thing on the stack is the tasks ulUsingFPU value, which by
|
/* The last thing on the stack is the tasks ulUsingFPU value, which by
|
||||||
* default is set to indicate that the stack frame does not include FPU
|
default is set to indicate that the stack frame does not include FPU
|
||||||
* registers. */
|
registers. */
|
||||||
*pxTopOfStack = pdFALSE;
|
*pxTopOfStack = pdFALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -209,7 +207,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
ulCriticalNesting = 0;
|
ulCriticalNesting = 0;
|
||||||
|
|
||||||
/* Start the first task. This is done from portASM.asm as ARM mode must be
|
/* Start the first task. This is done from portASM.asm as ARM mode must be
|
||||||
* used. */
|
used. */
|
||||||
vPortStartFirstTask();
|
vPortStartFirstTask();
|
||||||
|
|
||||||
/* Should not get here! */
|
/* Should not get here! */
|
||||||
|
@ -223,7 +221,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler(void)
|
void vPortEndScheduler(void)
|
||||||
{
|
{
|
||||||
/* Not implemented in ports where there is nothing to return to.
|
/* Not implemented in ports where there is nothing to return to.
|
||||||
* Artificially force an assert. */
|
Artificially force an assert. */
|
||||||
configASSERT( ulCriticalNesting == 1000UL );
|
configASSERT( ulCriticalNesting == 1000UL );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -238,11 +236,11 @@ void vPortEndScheduler( void )
|
||||||
portRTI_INTFLAG_REG = 0x00000001;
|
portRTI_INTFLAG_REG = 0x00000001;
|
||||||
|
|
||||||
/* Increment the tick count - this may make a delaying task ready
|
/* Increment the tick count - this may make a delaying task ready
|
||||||
* to run - but a context switch is not performed. */
|
to run - but a context switch is not performed. */
|
||||||
xTaskIncrementTick();
|
xTaskIncrementTick();
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* if configUSE_PREEMPTION == 0 */
|
#else
|
||||||
|
|
||||||
/*
|
/*
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
|
@ -253,7 +251,7 @@ void vPortEndScheduler( void )
|
||||||
*/
|
*/
|
||||||
void vPortPreemptiveTick( void );
|
void vPortPreemptiveTick( void );
|
||||||
|
|
||||||
#endif /* if configUSE_PREEMPTION == 0 */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -266,8 +264,8 @@ void vPortEnterCritical( void )
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -284,7 +282,7 @@ void vPortExitCritical( void )
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then interrupts should be
|
/* If the nesting level has reached zero then interrupts should be
|
||||||
* re-enabled. */
|
re-enabled. */
|
||||||
if( ulCriticalNesting == 0 )
|
if( ulCriticalNesting == 0 )
|
||||||
{
|
{
|
||||||
/* Enable interrupts as per portENABLE_INTERRUPTS(). */
|
/* Enable interrupts as per portENABLE_INTERRUPTS(). */
|
||||||
|
@ -301,7 +299,7 @@ void vPortExitCritical( void )
|
||||||
extern void vPortInitialiseFPSCR( void );
|
extern void vPortInitialiseFPSCR( void );
|
||||||
|
|
||||||
/* A task is registering the fact that it needs an FPU context. Set the
|
/* A task is registering the fact that it needs an FPU context. Set the
|
||||||
* FPU flag (saved as part of the task context. */
|
FPU flag (saved as part of the task context. */
|
||||||
ulTaskHasFPUContext = pdTRUE;
|
ulTaskHasFPUContext = pdTRUE;
|
||||||
|
|
||||||
/* Initialise the floating point status register. */
|
/* Initialise the floating point status register. */
|
||||||
|
@ -311,3 +309,4 @@ void vPortExitCritical( void )
|
||||||
#endif /* __TI_VFP_SUPPORT__ */
|
#endif /* __TI_VFP_SUPPORT__ */
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
; *
|
; *
|
||||||
; * http://www.FreeRTOS.org
|
; * https://www.FreeRTOS.org
|
||||||
; * http://aws.amazon.com/freertos
|
; * https://github.com/FreeRTOS
|
||||||
; *
|
; *
|
||||||
; * 1 tab == 4 spaces!
|
; * 1 tab == 4 spaces!
|
||||||
; */
|
; */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ typedef unsigned long UBaseType_t;
|
||||||
#define portMAX_DELAY (TickType_t) 0xFFFFFFFFF
|
#define portMAX_DELAY (TickType_t) 0xFFFFFFFFF
|
||||||
|
|
||||||
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
|
/* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
|
||||||
* not need to be guarded with a critical section. */
|
not need to be guarded with a critical section. */
|
||||||
#define portTICK_TYPE_IS_ATOMIC 1
|
#define portTICK_TYPE_IS_ATOMIC 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -114,3 +114,4 @@ extern void vPortYield( void );
|
||||||
#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
|
#define portTASK_FUNCTION_PROTO(vFunction, pvParameters) void vFunction(void *pvParameters)
|
||||||
|
|
||||||
#endif /* __PORTMACRO_H__ */
|
#endif /* __PORTMACRO_H__ */
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
;/*
|
;/*
|
||||||
* ; * FreeRTOS Kernel V10.3.1
|
; * FreeRTOS Kernel V10.3.1
|
||||||
* ; * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
; * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||||
* ; *
|
; *
|
||||||
* ; * Permission is hereby granted, free of charge, to any person obtaining a copy of
|
; * Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
* ; * this software and associated documentation files (the "Software"), to deal in
|
; * this software and associated documentation files (the "Software"), to deal in
|
||||||
* ; * the Software without restriction, including without limitation the rights to
|
; * the Software without restriction, including without limitation the rights to
|
||||||
* ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
* ; * the Software, and to permit persons to whom the Software is furnished to do so,
|
; * the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
* ; * subject to the following conditions:
|
; * subject to the following conditions:
|
||||||
* ; *
|
; *
|
||||||
* ; * The above copyright notice and this permission notice shall be included in all
|
; * The above copyright notice and this permission notice shall be included in all
|
||||||
* ; * copies or substantial portions of the Software.
|
; * copies or substantial portions of the Software.
|
||||||
* ; *
|
; *
|
||||||
* ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
* ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
* ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
* ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
* ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
* ; *
|
; *
|
||||||
* ; * http://www.FreeRTOS.org
|
; * https://www.FreeRTOS.org
|
||||||
* ; * http://aws.amazon.com/freertos
|
; * https://github.com/FreeRTOS
|
||||||
* ; *
|
; *
|
||||||
* ; * 1 tab == 4 spaces!
|
; * 1 tab == 4 spaces!
|
||||||
* ; */
|
; */
|
||||||
|
|
||||||
.if $DEFINED( __LARGE_DATA_MODEL__ )
|
.if $DEFINED( __LARGE_DATA_MODEL__ )
|
||||||
.define "pushm.a", pushm_x
|
.define "pushm.a", pushm_x
|
||||||
|
@ -46,3 +46,8 @@
|
||||||
.define "call", call_x
|
.define "call", call_x
|
||||||
.define "ret", ret_x
|
.define "ret", ret_x
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -34,24 +34,24 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/* Constants required for hardware setup. The tick ISR runs off the ACLK,
|
/* Constants required for hardware setup. The tick ISR runs off the ACLK,
|
||||||
* not the MCLK. */
|
not the MCLK. */
|
||||||
#define portACLK_FREQUENCY_HZ ( ( TickType_t ) 32768 )
|
#define portACLK_FREQUENCY_HZ ( ( TickType_t ) 32768 )
|
||||||
#define portINITIAL_CRITICAL_NESTING ( ( uint16_t ) 10 )
|
#define portINITIAL_CRITICAL_NESTING ( ( uint16_t ) 10 )
|
||||||
#define portFLAGS_INT_ENABLED ( ( StackType_t ) 0x08 )
|
#define portFLAGS_INT_ENABLED ( ( StackType_t ) 0x08 )
|
||||||
|
|
||||||
/* We require the address of the pxCurrentTCB variable, but don't want to know
|
/* We require the address of the pxCurrentTCB variable, but don't want to know
|
||||||
* any details of its type. */
|
any details of its type. */
|
||||||
typedef void TCB_t;
|
typedef void TCB_t;
|
||||||
extern volatile TCB_t * volatile pxCurrentTCB;
|
extern volatile TCB_t * volatile pxCurrentTCB;
|
||||||
|
|
||||||
/* Each task maintains a count of the critical section nesting depth. Each
|
/* Each task maintains a count of the critical section nesting depth. Each
|
||||||
* time a critical section is entered the count is incremented. Each time a
|
time a critical section is entered the count is incremented. Each time a
|
||||||
* critical section is exited the count is decremented - with interrupts only
|
critical section is exited the count is decremented - with interrupts only
|
||||||
* being re-enabled if the count is zero.
|
being re-enabled if the count is zero.
|
||||||
*
|
|
||||||
* usCriticalNesting will get set to zero when the scheduler starts, but must
|
usCriticalNesting will get set to zero when the scheduler starts, but must
|
||||||
* not be initialised to zero as this will cause problems during the startup
|
not be initialised to zero as this will cause problems during the startup
|
||||||
* sequence. */
|
sequence. */
|
||||||
volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
|
volatile uint16_t usCriticalNesting = portINITIAL_CRITICAL_NESTING;
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -69,27 +69,25 @@ void vPortSetupTimerInterrupt( void );
|
||||||
*
|
*
|
||||||
* See the header file portable.h.
|
* See the header file portable.h.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
uint16_t *pusTopOfStack;
|
uint16_t *pusTopOfStack;
|
||||||
uint32_t *pulTopOfStack, ulTemp;
|
uint32_t *pulTopOfStack, ulTemp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Place a few bytes of known values on the bottom of the stack.
|
Place a few bytes of known values on the bottom of the stack.
|
||||||
* This is just useful for debugging and can be included if required.
|
This is just useful for debugging and can be included if required.
|
||||||
*
|
|
||||||
*pxTopOfStack = ( StackType_t ) 0x1111;
|
*pxTopOfStack = ( StackType_t ) 0x1111;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0x2222;
|
*pxTopOfStack = ( StackType_t ) 0x2222;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0x3333;
|
*pxTopOfStack = ( StackType_t ) 0x3333;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Data types are need either 16 bits or 32 bits depending on the data
|
/* Data types are need either 16 bits or 32 bits depending on the data
|
||||||
* and code model used. */
|
and code model used. */
|
||||||
if( sizeof( pxCode ) == sizeof( uint16_t ) )
|
if( sizeof( pxCode ) == sizeof( uint16_t ) )
|
||||||
{
|
{
|
||||||
pusTopOfStack = ( uint16_t * ) pxTopOfStack;
|
pusTopOfStack = ( uint16_t * ) pxTopOfStack;
|
||||||
|
@ -138,19 +136,19 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0x4444;
|
*pxTopOfStack = ( StackType_t ) 0x4444;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
#else /* ifdef PRELOAD_REGISTER_VALUES */
|
#else
|
||||||
pxTopOfStack -= 3;
|
pxTopOfStack -= 3;
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters;
|
*pxTopOfStack = ( StackType_t ) pvParameters;
|
||||||
pxTopOfStack -= 9;
|
pxTopOfStack -= 9;
|
||||||
#endif /* ifdef PRELOAD_REGISTER_VALUES */
|
#endif
|
||||||
|
|
||||||
/* A variable is used to keep track of the critical section nesting.
|
/* A variable is used to keep track of the critical section nesting.
|
||||||
* This variable has to be stored as part of the task context and is
|
This variable has to be stored as part of the task context and is
|
||||||
* initially set to zero. */
|
initially set to zero. */
|
||||||
*pxTopOfStack = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
|
*pxTopOfStack = ( StackType_t ) portNO_CRITICAL_SECTION_NESTING;
|
||||||
|
|
||||||
/* Return a pointer to the top of the stack we have generated so this can
|
/* Return a pointer to the top of the stack we have generated so this can
|
||||||
* be stored in the task control block for the task. */
|
be stored in the task control block for the task. */
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -158,7 +156,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* It is unlikely that the MSP430 port will get stopped. If required simply
|
/* It is unlikely that the MSP430 port will get stopped. If required simply
|
||||||
* disable the tick interrupt here. */
|
disable the tick interrupt here. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -185,3 +183,5 @@ interrupt void vTickISREntry( void )
|
||||||
vPortCooperativeTickISR();
|
vPortCooperativeTickISR();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
; *
|
; *
|
||||||
; * http://www.FreeRTOS.org
|
; * https://www.FreeRTOS.org
|
||||||
; * http://aws.amazon.com/freertos
|
; * https://github.com/FreeRTOS
|
||||||
; *
|
; *
|
||||||
; * 1 tab == 4 spaces!
|
; * 1 tab == 4 spaces!
|
||||||
; */
|
; */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -136,7 +136,8 @@ extern void vTaskSwitchContext( void );
|
||||||
void vApplicationSetupTimerInterrupt( void );
|
void vApplicationSetupTimerInterrupt( void );
|
||||||
|
|
||||||
/* sizeof( int ) != sizeof( long ) so a full printf() library is required if
|
/* sizeof( int ) != sizeof( long ) so a full printf() library is required if
|
||||||
* run time stats information is to be displayed. */
|
run time stats information is to be displayed. */
|
||||||
#define portLU_PRINTF_SPECIFIER_REQUIRED
|
#define portLU_PRINTF_SPECIFIER_REQUIRED
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -45,20 +45,17 @@ asm void interrupt VectorNumber_VL1swi vPortYieldISR( void );
|
||||||
static void prvSetupTimerInterrupt( void );
|
static void prvSetupTimerInterrupt( void );
|
||||||
|
|
||||||
/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This
|
/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This
|
||||||
* will be set to 0 prior to the first task being started. */
|
will be set to 0 prior to the first task being started. */
|
||||||
static uint32_t ulCriticalNesting = 0x9999UL;
|
static uint32_t ulCriticalNesting = 0x9999UL;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
|
|
||||||
uint32_t ulOriginalA5;
|
uint32_t ulOriginalA5;
|
||||||
|
|
||||||
__asm {
|
__asm{ MOVE.L A5, ulOriginalA5 };
|
||||||
MOVE.L A5, ulOriginalA5
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
*pxTopOfStack = (StackType_t) 0xDEADBEEF;
|
*pxTopOfStack = (StackType_t) 0xDEADBEEF;
|
||||||
|
@ -109,7 +106,7 @@ static void prvSetupTimerInterrupt( void )
|
||||||
RTCMOD = portRTC_CLOCK_HZ / configTICK_RATE_HZ;
|
RTCMOD = portRTC_CLOCK_HZ / configTICK_RATE_HZ;
|
||||||
|
|
||||||
/* Enable the RTC to generate interrupts - interrupts are already disabled
|
/* Enable the RTC to generate interrupts - interrupts are already disabled
|
||||||
* when this code executes. */
|
when this code executes. */
|
||||||
RTCSC_RTIE = 1;
|
RTCSC_RTIE = 1;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -125,20 +122,19 @@ void vPortEnterCritical( void )
|
||||||
if( ulCriticalNesting == 0UL )
|
if( ulCriticalNesting == 0UL )
|
||||||
{
|
{
|
||||||
/* Guard against context switches being pended simultaneously with a
|
/* Guard against context switches being pended simultaneously with a
|
||||||
* critical section being entered. */
|
critical section being entered. */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
if( INTC_FRC == 0UL )
|
if( INTC_FRC == 0UL )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
|
||||||
} while( 1 );
|
} while( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -146,7 +142,6 @@ void vPortEnterCritical( void )
|
||||||
void vPortExitCritical( void )
|
void vPortExitCritical( void )
|
||||||
{
|
{
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
if( ulCriticalNesting == 0 )
|
if( ulCriticalNesting == 0 )
|
||||||
{
|
{
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
@ -185,3 +180,4 @@ void interrupt VectorNumber_Vrtc vPortTickISR( void )
|
||||||
}
|
}
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -101,8 +101,7 @@
|
||||||
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) \
|
||||||
if( xSwitchRequired != pdFALSE ) \
|
|
||||||
{ \
|
{ \
|
||||||
portYIELD(); \
|
portYIELD(); \
|
||||||
}
|
}
|
||||||
|
@ -113,3 +112,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
#define portINITIAL_STATUS_REGISTER ( ( StackType_t ) 0x2000)
|
#define portINITIAL_STATUS_REGISTER ( ( StackType_t ) 0x2000)
|
||||||
|
|
||||||
/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This
|
/* Used to keep track of the number of nested calls to taskENTER_CRITICAL(). This
|
||||||
* will be set to 0 prior to the first task being started. */
|
will be set to 0 prior to the first task being started. */
|
||||||
static uint32_t ulCriticalNesting = 0x9999UL;
|
static uint32_t ulCriticalNesting = 0x9999UL;
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,9 +57,7 @@ static uint32_t ulCriticalNesting = 0x9999UL;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t * pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters;
|
*pxTopOfStack = ( StackType_t ) pvParameters;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -108,20 +106,19 @@ void vPortEnterCritical( void )
|
||||||
if( ulCriticalNesting == 0UL )
|
if( ulCriticalNesting == 0UL )
|
||||||
{
|
{
|
||||||
/* Guard against context switches being pended simultaneously with a
|
/* Guard against context switches being pended simultaneously with a
|
||||||
* critical section being entered. */
|
critical section being entered. */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
if( MCF_INTC0_INTFRCH == 0UL )
|
if( MCF_INTC0_INTFRCH == 0UL )
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
|
||||||
} while( 1 );
|
} while( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -129,7 +126,6 @@ void vPortEnterCritical( void )
|
||||||
void vPortExitCritical( void )
|
void vPortExitCritical( void )
|
||||||
{
|
{
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
if( ulCriticalNesting == 0 )
|
if( ulCriticalNesting == 0 )
|
||||||
{
|
{
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
@ -148,3 +144,4 @@ void vPortYieldHandler( void )
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( ulSavedInterruptMask );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -100,8 +100,7 @@
|
||||||
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#define portEND_SWITCHING_ISR( xSwitchRequired ) \
|
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) \
|
||||||
if( xSwitchRequired != pdFALSE ) \
|
|
||||||
{ \
|
{ \
|
||||||
portYIELD(); \
|
portYIELD(); \
|
||||||
}
|
}
|
||||||
|
@ -112,3 +111,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
static void prvSetupTimerInterrupt( void );
|
static void prvSetupTimerInterrupt( void );
|
||||||
|
|
||||||
/* Interrupt service routines have to be in non-banked memory - as does the
|
/* Interrupt service routines have to be in non-banked memory - as does the
|
||||||
* scheduler startup function. */
|
scheduler startup function. */
|
||||||
#pragma CODE_SEG __NEAR_SEG NON_BANKED
|
#pragma CODE_SEG __NEAR_SEG NON_BANKED
|
||||||
|
|
||||||
/* Manual context switch function. This is the SWI ISR. */
|
/* Manual context switch function. This is the SWI ISR. */
|
||||||
|
@ -52,19 +52,19 @@ void interrupt vPortYield( void );
|
||||||
void interrupt vPortTickInterrupt( void );
|
void interrupt vPortTickInterrupt( void );
|
||||||
|
|
||||||
/* Simply called by xPortStartScheduler(). xPortStartScheduler() does not
|
/* Simply called by xPortStartScheduler(). xPortStartScheduler() does not
|
||||||
* start the scheduler directly because the header file containing the
|
start the scheduler directly because the header file containing the
|
||||||
* xPortStartScheduler() prototype is part of the common kernel code, and
|
xPortStartScheduler() prototype is part of the common kernel code, and
|
||||||
* therefore cannot use the CODE_SEG pragma. */
|
therefore cannot use the CODE_SEG pragma. */
|
||||||
static BaseType_t xBankedStartScheduler( void );
|
static BaseType_t xBankedStartScheduler( void );
|
||||||
|
|
||||||
#pragma CODE_SEG DEFAULT
|
#pragma CODE_SEG DEFAULT
|
||||||
|
|
||||||
/* Calls to portENTER_CRITICAL() can be nested. When they are nested the
|
/* Calls to portENTER_CRITICAL() can be nested. When they are nested the
|
||||||
* critical section should not be left (i.e. interrupts should not be re-enabled)
|
critical section should not be left (i.e. interrupts should not be re-enabled)
|
||||||
* until the nesting depth reaches 0. This variable simply tracks the nesting
|
until the nesting depth reaches 0. This variable simply tracks the nesting
|
||||||
* depth. Each task maintains it's own critical nesting depth variable so
|
depth. Each task maintains it's own critical nesting depth variable so
|
||||||
* uxCriticalNesting is saved and restored from the task stack during a context
|
uxCriticalNesting is saved and restored from the task stack during a context
|
||||||
* switch. */
|
switch. */
|
||||||
volatile UBaseType_t uxCriticalNesting = 0xff;
|
volatile UBaseType_t uxCriticalNesting = 0xff;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -72,27 +72,25 @@ volatile UBaseType_t uxCriticalNesting = 0xff;
|
||||||
/*
|
/*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Place a few bytes of known values on the bottom of the stack.
|
Place a few bytes of known values on the bottom of the stack.
|
||||||
* This can be uncommented to provide useful stack markers when debugging.
|
This can be uncommented to provide useful stack markers when debugging.
|
||||||
*
|
|
||||||
*pxTopOfStack = ( StackType_t ) 0x11;
|
*pxTopOfStack = ( StackType_t ) 0x11;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0x22;
|
*pxTopOfStack = ( StackType_t ) 0x22;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*pxTopOfStack = ( StackType_t ) 0x33;
|
*pxTopOfStack = ( StackType_t ) 0x33;
|
||||||
* pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. In this case the stack as
|
expected by the portRESTORE_CONTEXT() macro. In this case the stack as
|
||||||
* expected by the HCS12 RTI instruction. */
|
expected by the HCS12 RTI instruction. */
|
||||||
|
|
||||||
|
|
||||||
/* The address of the task function is placed in the stack byte at a time. */
|
/* The address of the task function is placed in the stack byte at a time. */
|
||||||
|
@ -124,7 +122,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* CCR: Note that when the task starts interrupts will be enabled since
|
/* CCR: Note that when the task starts interrupts will be enabled since
|
||||||
* "I" bit of CCR is cleared */
|
"I" bit of CCR is cleared */
|
||||||
*pxTopOfStack = ( StackType_t ) 0x00;
|
*pxTopOfStack = ( StackType_t ) 0x00;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -135,7 +133,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Finally the critical nesting depth is initialised with 0 (not within
|
/* Finally the critical nesting depth is initialised with 0 (not within
|
||||||
* a critical section). */
|
a critical section). */
|
||||||
*pxTopOfStack = ( StackType_t ) 0x00;
|
*pxTopOfStack = ( StackType_t ) 0x00;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -158,10 +156,10 @@ static void prvSetupTimerInterrupt( void )
|
||||||
BaseType_t xPortStartScheduler( void )
|
BaseType_t xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* xPortStartScheduler() does not start the scheduler directly because
|
/* xPortStartScheduler() does not start the scheduler directly because
|
||||||
* the header file containing the xPortStartScheduler() prototype is part
|
the header file containing the xPortStartScheduler() prototype is part
|
||||||
* of the common kernel code, and therefore cannot use the CODE_SEG pragma.
|
of the common kernel code, and therefore cannot use the CODE_SEG pragma.
|
||||||
* Instead it simply calls the locally defined xBankedStartScheduler() -
|
Instead it simply calls the locally defined xBankedStartScheduler() -
|
||||||
* which does use the CODE_SEG pragma. */
|
which does use the CODE_SEG pragma. */
|
||||||
|
|
||||||
return xBankedStartScheduler();
|
return xBankedStartScheduler();
|
||||||
}
|
}
|
||||||
|
@ -172,7 +170,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
static BaseType_t xBankedStartScheduler( void )
|
static BaseType_t xBankedStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* Configure the timer that will generate the RTOS tick. Interrupts are
|
/* Configure the timer that will generate the RTOS tick. Interrupts are
|
||||||
* disabled when this function is called. */
|
disabled when this function is called. */
|
||||||
prvSetupTimerInterrupt();
|
prvSetupTimerInterrupt();
|
||||||
|
|
||||||
/* Restore the context of the first task. */
|
/* Restore the context of the first task. */
|
||||||
|
@ -223,15 +221,17 @@ void interrupt vPortTickInterrupt( void )
|
||||||
TFLG1 = 1;
|
TFLG1 = 1;
|
||||||
|
|
||||||
/* Restore the context of a task - which may be a different task
|
/* Restore the context of a task - which may be a different task
|
||||||
* to that interrupted. */
|
to that interrupted. */
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
#else /* if configUSE_PREEMPTION == 1 */
|
#else
|
||||||
{
|
{
|
||||||
xTaskIncrementTick();
|
xTaskIncrementTick();
|
||||||
TFLG1 = 1;
|
TFLG1 = 1;
|
||||||
}
|
}
|
||||||
#endif /* if configUSE_PREEMPTION == 1 */
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma CODE_SEG DEFAULT
|
#pragma CODE_SEG DEFAULT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -117,7 +117,6 @@ typedef unsigned char UBaseType_t;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef BANKED_MODEL
|
#ifdef BANKED_MODEL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the stack pointer for the task, then pull the critical nesting
|
* Load the stack pointer for the task, then pull the critical nesting
|
||||||
* count and PPAGE register from the stack. The remains of the
|
* count and PPAGE register from the stack. The remains of the
|
||||||
|
@ -153,7 +152,7 @@ typedef unsigned char UBaseType_t;
|
||||||
__asm( "ldx pxCurrentTCB" ); \
|
__asm( "ldx pxCurrentTCB" ); \
|
||||||
__asm( "sts 0, x" ); \
|
__asm( "sts 0, x" ); \
|
||||||
}
|
}
|
||||||
#else /* ifdef BANKED_MODEL */
|
#else
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These macros are as per the BANKED versions above, but without saving
|
* These macros are as per the BANKED versions above, but without saving
|
||||||
|
@ -181,7 +180,7 @@ typedef unsigned char UBaseType_t;
|
||||||
__asm( "ldx pxCurrentTCB" ); \
|
__asm( "ldx pxCurrentTCB" ); \
|
||||||
__asm( "sts 0, x" ); \
|
__asm( "sts 0, x" ); \
|
||||||
}
|
}
|
||||||
#endif /* ifdef BANKED_MODEL */
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utility macro to call macros above in correct order in order to perform a
|
* Utility macro to call macros above in correct order in order to perform a
|
||||||
|
@ -200,3 +199,4 @@ typedef unsigned char UBaseType_t;
|
||||||
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,9 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -68,7 +67,7 @@ BaseType_t xPortRaisePrivilege( void ) /* FREERTOS_SYSTEM_CALL */
|
||||||
xRunningPrivileged = portIS_PRIVILEGED();
|
xRunningPrivileged = portIS_PRIVILEGED();
|
||||||
|
|
||||||
/* If the processor is not already privileged, raise privilege. */
|
/* If the processor is not already privileged, raise privilege. */
|
||||||
if( xRunningPrivileged != pdTRUE )
|
if( xRunningPrivileged == pdFALSE )
|
||||||
{
|
{
|
||||||
portRAISE_PRIVILEGE();
|
portRAISE_PRIVILEGE();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +78,7 @@ BaseType_t xPortRaisePrivilege( void ) /* FREERTOS_SYSTEM_CALL */
|
||||||
|
|
||||||
void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
void vPortResetPrivilege( BaseType_t xRunningPrivileged )
|
||||||
{
|
{
|
||||||
if( xRunningPrivileged != pdTRUE )
|
if( xRunningPrivileged == pdFALSE )
|
||||||
{
|
{
|
||||||
portRESET_PRIVILEGE();
|
portRESET_PRIVILEGE();
|
||||||
}
|
}
|
||||||
|
@ -958,33 +957,6 @@ void MPU_vQueueDelete( QueueHandle_t xQueue ) /* FREERTOS_SYSTEM_CALL */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
|
||||||
void * MPU_pvPortMalloc( size_t xSize ) /* FREERTOS_SYSTEM_CALL */
|
|
||||||
{
|
|
||||||
void * pvReturn;
|
|
||||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
|
||||||
|
|
||||||
pvReturn = pvPortMalloc( xSize );
|
|
||||||
|
|
||||||
vPortResetPrivilege( xRunningPrivileged );
|
|
||||||
|
|
||||||
return pvReturn;
|
|
||||||
}
|
|
||||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
|
||||||
void MPU_vPortFree( void * pv ) /* FREERTOS_SYSTEM_CALL */
|
|
||||||
{
|
|
||||||
BaseType_t xRunningPrivileged = xPortRaisePrivilege();
|
|
||||||
|
|
||||||
vPortFree( pv );
|
|
||||||
|
|
||||||
vPortResetPrivilege( xRunningPrivileged );
|
|
||||||
}
|
|
||||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
|
||||||
/*-----------------------------------------------------------*/
|
|
||||||
|
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||||
void MPU_vPortInitialiseBlocks( void ) /* FREERTOS_SYSTEM_CALL */
|
void MPU_vPortInitialiseBlocks( void ) /* FREERTOS_SYSTEM_CALL */
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -73,24 +73,22 @@ extern void vPortISRStartFirstTask( void );
|
||||||
*
|
*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t *pxOriginalTOS;
|
StackType_t *pxOriginalTOS;
|
||||||
|
|
||||||
pxOriginalTOS = pxTopOfStack;
|
pxOriginalTOS = pxTopOfStack;
|
||||||
|
|
||||||
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
||||||
* is not really required. */
|
is not really required. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First on the stack is the return address - which in this case is the
|
/* First on the stack is the return address - which in this case is the
|
||||||
* start of the task. The offset is added to make the return address appear
|
start of the task. The offset is added to make the return address appear
|
||||||
* as it would within an IRQ ISR. */
|
as it would within an IRQ ISR. */
|
||||||
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -124,12 +122,12 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* When the task starts is will expect to find the function parameter in
|
||||||
* R0. */
|
R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The last thing onto the stack is the status register, which is set for
|
/* The last thing onto the stack is the status register, which is set for
|
||||||
* system mode, with interrupts enabled. */
|
system mode, with interrupts enabled. */
|
||||||
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
||||||
|
|
||||||
#ifdef THUMB_INTERWORK
|
#ifdef THUMB_INTERWORK
|
||||||
|
@ -142,9 +140,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Some optimisation levels use the stack differently to others. This
|
/* Some optimisation levels use the stack differently to others. This
|
||||||
* means the interrupt flags cannot always be stored on the stack and will
|
means the interrupt flags cannot always be stored on the stack and will
|
||||||
* instead be stored in a variable, which is then saved as part of the
|
instead be stored in a variable, which is then saved as part of the
|
||||||
* tasks context. */
|
tasks context. */
|
||||||
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -154,7 +152,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
BaseType_t xPortStartScheduler( void )
|
BaseType_t xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
here already. */
|
||||||
prvSetupTimerInterrupt();
|
prvSetupTimerInterrupt();
|
||||||
|
|
||||||
/* Start the first task. */
|
/* Start the first task. */
|
||||||
|
@ -168,7 +166,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* It is unlikely that the ARM port will require this function as there
|
/* It is unlikely that the ARM port will require this function as there
|
||||||
* is nothing to return to. */
|
is nothing to return to. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -192,8 +190,8 @@ static void prvSetupTimerInterrupt( void )
|
||||||
ulDummy = portTIMER_REG_BASE_PTR->TC_SR;
|
ulDummy = portTIMER_REG_BASE_PTR->TC_SR;
|
||||||
|
|
||||||
/* Store interrupt handler function address in tick timer vector register...
|
/* Store interrupt handler function address in tick timer vector register...
|
||||||
* The ISR installed depends on whether the preemptive or cooperative
|
The ISR installed depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
#if configUSE_PREEMPTION == 1
|
#if configUSE_PREEMPTION == 1
|
||||||
{
|
{
|
||||||
extern void ( vPreemptiveTick )( void );
|
extern void ( vPreemptiveTick )( void );
|
||||||
|
@ -210,8 +208,8 @@ static void prvSetupTimerInterrupt( void )
|
||||||
AT91C_BASE_AIC->AIC_SMR[ portTIMER_AIC_CHANNEL ] = AIC_SRCTYPE_INT_LEVEL_SENSITIVE | portTICK_PRIORITY_6;
|
AT91C_BASE_AIC->AIC_SMR[ portTIMER_AIC_CHANNEL ] = AIC_SRCTYPE_INT_LEVEL_SENSITIVE | portTICK_PRIORITY_6;
|
||||||
|
|
||||||
/* Enable the tick timer interrupt...
|
/* Enable the tick timer interrupt...
|
||||||
*
|
|
||||||
* First at timer level */
|
First at timer level */
|
||||||
portTIMER_REG_BASE_PTR->TC_IER = TC_CPCS;
|
portTIMER_REG_BASE_PTR->TC_IER = TC_CPCS;
|
||||||
|
|
||||||
/* Then at the AIC level. */
|
/* Then at the AIC level. */
|
||||||
|
@ -221,14 +219,14 @@ static void prvSetupTimerInterrupt( void )
|
||||||
if( (configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2) ) <= 0xFFFF )
|
if( (configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2) ) <= 0xFFFF )
|
||||||
{
|
{
|
||||||
/* The tick rate is fast enough for us to use the faster timer input
|
/* The tick rate is fast enough for us to use the faster timer input
|
||||||
* clock (main clock / 2). */
|
clock (main clock / 2). */
|
||||||
portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK2 | TC_BURST_NONE | TC_CPCTRG;
|
portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK2 | TC_BURST_NONE | TC_CPCTRG;
|
||||||
portTIMER_REG_BASE_PTR->TC_RC = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2);
|
portTIMER_REG_BASE_PTR->TC_RC = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We must use a slower timer input clock (main clock / 8) because the
|
/* We must use a slower timer input clock (main clock / 8) because the
|
||||||
* tick rate is too slow for the faster input clock. */
|
tick rate is too slow for the faster input clock. */
|
||||||
portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK8 | TC_BURST_NONE | TC_CPCTRG;
|
portTIMER_REG_BASE_PTR->TC_CMR = TC_WAVE | TC_CLKS_MCK8 | TC_BURST_NONE | TC_CPCTRG;
|
||||||
portTIMER_REG_BASE_PTR->TC_RC = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 8);
|
portTIMER_REG_BASE_PTR->TC_RC = configCPU_CLOCK_HZ / (configTICK_RATE_HZ * 8);
|
||||||
}
|
}
|
||||||
|
@ -237,3 +235,4 @@ static void prvSetupTimerInterrupt( void )
|
||||||
portTIMER_REG_BASE_PTR->TC_CCR = TC_SWTRG | TC_CLKEN;
|
portTIMER_REG_BASE_PTR->TC_CCR = TC_SWTRG | TC_CLKEN;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -33,10 +33,10 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
*
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void vPortISRStartFirstTask( void );
|
||||||
void vPortISRStartFirstTask( void )
|
void vPortISRStartFirstTask( void )
|
||||||
{
|
{
|
||||||
/* Simply start the scheduler. This is included here as it can only be
|
/* Simply start the scheduler. This is included here as it can only be
|
||||||
* called from ARM mode. */
|
called from ARM mode. */
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -82,8 +82,8 @@ void vPortISRStartFirstTask( void )
|
||||||
void vPortYieldProcessor( void )
|
void vPortYieldProcessor( void )
|
||||||
{
|
{
|
||||||
/* Within an IRQ ISR the link register has an offset from the true return
|
/* Within an IRQ ISR the link register has an offset from the true return
|
||||||
* address, but an SWI ISR does not. Add the offset manually so the same
|
address, but an SWI ISR does not. Add the offset manually so the same
|
||||||
* ISR return code can be used in both cases. */
|
ISR return code can be used in both cases. */
|
||||||
asm volatile ( "ADD LR, LR, #4" );
|
asm volatile ( "ADD LR, LR, #4" );
|
||||||
|
|
||||||
/* Perform the context switch. First save the context of the current task. */
|
/* Perform the context switch. First save the context of the current task. */
|
||||||
|
@ -105,7 +105,7 @@ void vPortYieldProcessor( void )
|
||||||
#if configUSE_PREEMPTION == 0
|
#if configUSE_PREEMPTION == 0
|
||||||
|
|
||||||
/* The cooperative scheduler requires a normal IRQ service routine to
|
/* The cooperative scheduler requires a normal IRQ service routine to
|
||||||
* simply increment the system tick. */
|
simply increment the system tick. */
|
||||||
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
||||||
void vNonPreemptiveTick( void )
|
void vNonPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ void vPortYieldProcessor( void )
|
||||||
#else /* else preemption is turned on */
|
#else /* else preemption is turned on */
|
||||||
|
|
||||||
/* The preemptive scheduler is defined as "naked" as the full context is
|
/* The preemptive scheduler is defined as "naked" as the full context is
|
||||||
* saved on entry as part of the context switch. */
|
saved on entry as part of the context switch. */
|
||||||
void vPreemptiveTick( void ) __attribute__((naked));
|
void vPreemptiveTick( void ) __attribute__((naked));
|
||||||
void vPreemptiveTick( void )
|
void vPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -131,14 +131,14 @@ void vPortYieldProcessor( void )
|
||||||
portSAVE_CONTEXT();
|
portSAVE_CONTEXT();
|
||||||
|
|
||||||
/* WARNING - Do not use local (stack) variables here. Use globals
|
/* WARNING - Do not use local (stack) variables here. Use globals
|
||||||
* if you must! */
|
if you must! */
|
||||||
static volatile uint32_t ulDummy;
|
static volatile uint32_t ulDummy;
|
||||||
|
|
||||||
/* Clear tick timer interrupt indication. */
|
/* Clear tick timer interrupt indication. */
|
||||||
ulDummy = portTIMER_REG_BASE_PTR->TC_SR;
|
ulDummy = portTIMER_REG_BASE_PTR->TC_SR;
|
||||||
|
|
||||||
/* Increment the RTOS tick count, then look for the highest priority
|
/* Increment the RTOS tick count, then look for the highest priority
|
||||||
* task that is ready to run. */
|
task that is ready to run. */
|
||||||
if( xTaskIncrementTick() != pdFALSE )
|
if( xTaskIncrementTick() != pdFALSE )
|
||||||
{
|
{
|
||||||
vTaskSwitchContext();
|
vTaskSwitchContext();
|
||||||
|
@ -151,7 +151,7 @@ void vPortYieldProcessor( void )
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* if configUSE_PREEMPTION == 0 */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -190,9 +190,9 @@ void vPortYieldProcessor( void )
|
||||||
#endif /* THUMB_INTERWORK */
|
#endif /* THUMB_INTERWORK */
|
||||||
|
|
||||||
/* The code generated by the GCC compiler uses the stack in different ways at
|
/* The code generated by the GCC compiler uses the stack in different ways at
|
||||||
* different optimisation levels. The interrupt flags can therefore not always
|
different optimisation levels. The interrupt flags can therefore not always
|
||||||
* be saved to the stack. Instead the critical section nesting level is stored
|
be saved to the stack. Instead the critical section nesting level is stored
|
||||||
* in a variable, which is then saved as part of the stack context. */
|
in a variable, which is then saved as part of the stack context. */
|
||||||
void vPortEnterCritical( void )
|
void vPortEnterCritical( void )
|
||||||
{
|
{
|
||||||
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
||||||
|
@ -204,8 +204,8 @@ void vPortEnterCritical( void )
|
||||||
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
||||||
|
|
||||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ void vPortExitCritical( void )
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then interrupts should be
|
/* If the nesting level has reached zero then interrupts should be
|
||||||
* re-enabled. */
|
re-enabled. */
|
||||||
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
||||||
|
@ -230,3 +230,4 @@ void vPortExitCritical( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,33 +19,33 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V3.2.3
|
Changes from V3.2.3
|
||||||
*
|
|
||||||
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
||||||
+
|
|
||||||
+ Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
+
|
|
||||||
+ Removed the use of the %0 parameter within the assembler macros and
|
+ Removed the use of the %0 parameter within the assembler macros and
|
||||||
+ replaced them with hard coded registers. This will ensure the
|
replaced them with hard coded registers. This will ensure the
|
||||||
+ assembler does not select the link register as the temp register as
|
assembler does not select the link register as the temp register as
|
||||||
+ was occasionally happening previously.
|
was occasionally happening previously.
|
||||||
+
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
+
|
|
||||||
+ Changes from V4.5.0
|
Changes from V4.5.0
|
||||||
+
|
|
||||||
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
||||||
+ and replaced them with portYIELD_FROM_ISR() macro. Application code
|
and replaced them with portYIELD_FROM_ISR() macro. Application code
|
||||||
+ should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
||||||
+ macros as per the V4.5.1 demo code.
|
macros as per the V4.5.1 demo code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PORTMACRO_H
|
#ifndef PORTMACRO_H
|
||||||
|
@ -252,3 +252,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,50 +1,51 @@
|
||||||
/** ---------------------------------------------------------------------------- */
|
//* ----------------------------------------------------------------------------
|
||||||
/** ATMEL Microcontroller Software Support - ROUSSET - */
|
//* ATMEL Microcontroller Software Support - ROUSSET -
|
||||||
/** ---------------------------------------------------------------------------- */
|
//* ----------------------------------------------------------------------------
|
||||||
/** DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */
|
//* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
|
||||||
/** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
|
//* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
/** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */
|
//* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
|
||||||
/** DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */
|
//* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
/** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
|
//* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
/** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
|
//* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
|
||||||
/** OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */
|
//* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
/** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
|
//* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
/** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */
|
//* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||||
/** EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
|
//* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
/** ---------------------------------------------------------------------------- */
|
//* ----------------------------------------------------------------------------
|
||||||
/** File Name : lib_AT91SAM7X256.h */
|
//* File Name : lib_AT91SAM7X256.h
|
||||||
/** Object : AT91SAM7X256 inlined functions */
|
//* Object : AT91SAM7X256 inlined functions
|
||||||
/** Generated : AT91 SW Application Group 05/20/2005 (16:22:29) */
|
//* Generated : AT91 SW Application Group 05/20/2005 (16:22:29)
|
||||||
/** */
|
//*
|
||||||
/** CVS Reference : /lib_dbgu.h/1.1/Fri Jan 31 12:18:40 2003// */
|
//* CVS Reference : /lib_dbgu.h/1.1/Fri Jan 31 12:18:40 2003//
|
||||||
/** CVS Reference : /lib_pmc_SAM7X.h/1.1/Tue Feb 1 08:32:10 2005// */
|
//* CVS Reference : /lib_pmc_SAM7X.h/1.1/Tue Feb 1 08:32:10 2005//
|
||||||
/** CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005// */
|
//* CVS Reference : /lib_VREG_6085B.h/1.1/Tue Feb 1 16:20:47 2005//
|
||||||
/** CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004// */
|
//* CVS Reference : /lib_rstc_6098A.h/1.1/Wed Oct 6 10:39:20 2004//
|
||||||
/** CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003// */
|
//* CVS Reference : /lib_ssc.h/1.4/Fri Jan 31 12:19:20 2003//
|
||||||
/** CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004// */
|
//* CVS Reference : /lib_wdtc_6080A.h/1.1/Wed Oct 6 10:38:30 2004//
|
||||||
/** CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002// */
|
//* CVS Reference : /lib_usart.h/1.5/Thu Nov 21 16:01:54 2002//
|
||||||
/** CVS Reference : /lib_spi2.h/1.1/Mon Aug 25 14:23:52 2003// */
|
//* CVS Reference : /lib_spi2.h/1.1/Mon Aug 25 14:23:52 2003//
|
||||||
/** CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004// */
|
//* CVS Reference : /lib_pitc_6079A.h/1.2/Tue Nov 9 14:43:56 2004//
|
||||||
/** CVS Reference : /lib_aic_6075b.h/1.1/Fri May 20 14:01:19 2005// */
|
//* CVS Reference : /lib_aic_6075b.h/1.1/Fri May 20 14:01:19 2005//
|
||||||
/** CVS Reference : /lib_aes_6149a.h/1.1/Mon Jan 17 07:43:09 2005// */
|
//* CVS Reference : /lib_aes_6149a.h/1.1/Mon Jan 17 07:43:09 2005//
|
||||||
/** CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004// */
|
//* CVS Reference : /lib_twi.h/1.3/Mon Jul 19 14:27:58 2004//
|
||||||
/** CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003// */
|
//* CVS Reference : /lib_adc.h/1.6/Fri Oct 17 09:12:38 2003//
|
||||||
/** CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004// */
|
//* CVS Reference : /lib_rttc_6081A.h/1.1/Wed Oct 6 10:39:38 2004//
|
||||||
/** CVS Reference : /lib_udp.h/1.4/Wed Feb 16 08:39:34 2005// */
|
//* CVS Reference : /lib_udp.h/1.4/Wed Feb 16 08:39:34 2005//
|
||||||
/** CVS Reference : /lib_des3_6150a.h/1.1/Mon Jan 17 09:19:19 2005// */
|
//* CVS Reference : /lib_des3_6150a.h/1.1/Mon Jan 17 09:19:19 2005//
|
||||||
/** CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003// */
|
//* CVS Reference : /lib_tc_1753b.h/1.1/Fri Jan 31 12:20:02 2003//
|
||||||
/** CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004// */
|
//* CVS Reference : /lib_MC_SAM7X.h/1.1/Thu Mar 25 15:19:14 2004//
|
||||||
/** CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003// */
|
//* CVS Reference : /lib_pio.h/1.3/Fri Jan 31 12:18:56 2003//
|
||||||
/** CVS Reference : /lib_can_AT91.h/1.4/Fri Oct 17 09:12:50 2003// */
|
//* CVS Reference : /lib_can_AT91.h/1.4/Fri Oct 17 09:12:50 2003//
|
||||||
/** CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004// */
|
//* CVS Reference : /lib_PWM_SAM.h/1.3/Thu Jan 22 10:10:50 2004//
|
||||||
/** CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002// */
|
//* CVS Reference : /lib_pdc.h/1.2/Tue Jul 2 13:29:40 2002//
|
||||||
/** ---------------------------------------------------------------------------- */
|
//* ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#include "AT91SAM7X256.h"
|
#include "AT91SAM7X256.h"
|
||||||
|
|
||||||
|
|
||||||
/**---------------------------------------------------------------------------- */
|
//*----------------------------------------------------------------------------
|
||||||
/** \fn AT91F_AIC_ConfigureIt */
|
//* \fn AT91F_AIC_ConfigureIt
|
||||||
/** \brief Interrupt Handler Initialization */
|
//* \brief Interrupt Handler Initialization
|
||||||
/**---------------------------------------------------------------------------- */
|
//*----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -82,24 +82,22 @@ extern void vPortISRStartFirstTask( void );
|
||||||
*
|
*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t *pxOriginalTOS;
|
StackType_t *pxOriginalTOS;
|
||||||
|
|
||||||
pxOriginalTOS = pxTopOfStack;
|
pxOriginalTOS = pxTopOfStack;
|
||||||
|
|
||||||
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
||||||
* is not really required. */
|
is not really required. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First on the stack is the return address - which in this case is the
|
/* First on the stack is the return address - which in this case is the
|
||||||
* start of the task. The offset is added to make the return address appear
|
start of the task. The offset is added to make the return address appear
|
||||||
* as it would within an IRQ ISR. */
|
as it would within an IRQ ISR. */
|
||||||
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -133,12 +131,12 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* When the task starts is will expect to find the function parameter in
|
||||||
* R0. */
|
R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The last thing onto the stack is the status register, which is set for
|
/* The last thing onto the stack is the status register, which is set for
|
||||||
* system mode, with interrupts enabled. */
|
system mode, with interrupts enabled. */
|
||||||
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
||||||
|
|
||||||
#ifdef THUMB_INTERWORK
|
#ifdef THUMB_INTERWORK
|
||||||
|
@ -151,9 +149,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Some optimisation levels use the stack differently to others. This
|
/* Some optimisation levels use the stack differently to others. This
|
||||||
* means the interrupt flags cannot always be stored on the stack and will
|
means the interrupt flags cannot always be stored on the stack and will
|
||||||
* instead be stored in a variable, which is then saved as part of the
|
instead be stored in a variable, which is then saved as part of the
|
||||||
* tasks context. */
|
tasks context. */
|
||||||
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -163,7 +161,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
BaseType_t xPortStartScheduler( void )
|
BaseType_t xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
here already. */
|
||||||
prvSetupTimerInterrupt();
|
prvSetupTimerInterrupt();
|
||||||
|
|
||||||
/* Start the first task. */
|
/* Start the first task. */
|
||||||
|
@ -177,7 +175,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* It is unlikely that the ARM port will require this function as there
|
/* It is unlikely that the ARM port will require this function as there
|
||||||
* is nothing to return to. */
|
is nothing to return to. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -189,20 +187,27 @@ static void prvSetupTimerInterrupt( void )
|
||||||
AT91PS_PITC pxPIT = AT91C_BASE_PITC;
|
AT91PS_PITC pxPIT = AT91C_BASE_PITC;
|
||||||
|
|
||||||
/* Setup the AIC for PIT interrupts. The interrupt routine chosen depends
|
/* Setup the AIC for PIT interrupts. The interrupt routine chosen depends
|
||||||
* on whether the preemptive or cooperative scheduler is being used. */
|
on whether the preemptive or cooperative scheduler is being used. */
|
||||||
#if configUSE_PREEMPTION == 0
|
#if configUSE_PREEMPTION == 0
|
||||||
|
|
||||||
extern void ( vNonPreemptiveTick ) ( void );
|
extern void ( vNonPreemptiveTick ) ( void );
|
||||||
AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vNonPreemptiveTick );
|
AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vNonPreemptiveTick );
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
extern void ( vPreemptiveTick )( void );
|
extern void ( vPreemptiveTick )( void );
|
||||||
AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vPreemptiveTick );
|
AT91F_AIC_ConfigureIt( AT91C_ID_SYS, AT91C_AIC_PRIOR_HIGHEST, portINT_LEVEL_SENSITIVE, ( void (*)(void) ) vPreemptiveTick );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Configure the PIT period. */
|
/* Configure the PIT period. */
|
||||||
pxPIT->PITC_PIMR = portPIT_ENABLE | portPIT_INT_ENABLE | portPIT_COUNTER_VALUE;
|
pxPIT->PITC_PIMR = portPIT_ENABLE | portPIT_INT_ENABLE | portPIT_COUNTER_VALUE;
|
||||||
|
|
||||||
/* Enable the interrupt. Global interrupts are disables at this point so
|
/* Enable the interrupt. Global interrupts are disables at this point so
|
||||||
* this is safe. */
|
this is safe. */
|
||||||
AT91C_BASE_AIC->AIC_IECR = 0x1 << AT91C_ID_SYS;
|
AT91C_BASE_AIC->AIC_IECR = 0x1 << AT91C_ID_SYS;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -33,10 +33,10 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
*
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Scheduler includes. */
|
/* Scheduler includes. */
|
||||||
|
@ -68,7 +68,7 @@ void vPortISRStartFirstTask( void );
|
||||||
void vPortISRStartFirstTask( void )
|
void vPortISRStartFirstTask( void )
|
||||||
{
|
{
|
||||||
/* Simply start the scheduler. This is included here as it can only be
|
/* Simply start the scheduler. This is included here as it can only be
|
||||||
* called from ARM mode. */
|
called from ARM mode. */
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -84,8 +84,8 @@ void vPortISRStartFirstTask( void )
|
||||||
void vPortYieldProcessor( void )
|
void vPortYieldProcessor( void )
|
||||||
{
|
{
|
||||||
/* Within an IRQ ISR the link register has an offset from the true return
|
/* Within an IRQ ISR the link register has an offset from the true return
|
||||||
* address, but an SWI ISR does not. Add the offset manually so the same
|
address, but an SWI ISR does not. Add the offset manually so the same
|
||||||
* ISR return code can be used in both cases. */
|
ISR return code can be used in both cases. */
|
||||||
__asm volatile ( "ADD LR, LR, #4" );
|
__asm volatile ( "ADD LR, LR, #4" );
|
||||||
|
|
||||||
/* Perform the context switch. First save the context of the current task. */
|
/* Perform the context switch. First save the context of the current task. */
|
||||||
|
@ -107,15 +107,15 @@ void vPortYieldProcessor( void )
|
||||||
#if configUSE_PREEMPTION == 0
|
#if configUSE_PREEMPTION == 0
|
||||||
|
|
||||||
/* The cooperative scheduler requires a normal IRQ service routine to
|
/* The cooperative scheduler requires a normal IRQ service routine to
|
||||||
* simply increment the system tick. */
|
simply increment the system tick. */
|
||||||
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
||||||
void vNonPreemptiveTick( void )
|
void vNonPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
uint32_t ulDummy;
|
uint32_t ulDummy;
|
||||||
|
|
||||||
/* Increment the tick count - which may wake some tasks but as the
|
/* Increment the tick count - which may wake some tasks but as the
|
||||||
* preemptive scheduler is not being used any woken task is not given
|
preemptive scheduler is not being used any woken task is not given
|
||||||
* processor time no matter what its priority. */
|
processor time no matter what its priority. */
|
||||||
xTaskIncrementTick();
|
xTaskIncrementTick();
|
||||||
|
|
||||||
/* Clear the PIT interrupt. */
|
/* Clear the PIT interrupt. */
|
||||||
|
@ -125,10 +125,10 @@ void vPortYieldProcessor( void )
|
||||||
AT91C_BASE_AIC->AIC_EOICR = ulDummy;
|
AT91C_BASE_AIC->AIC_EOICR = ulDummy;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* if configUSE_PREEMPTION == 0 */
|
#else
|
||||||
|
|
||||||
/* The preemptive scheduler is defined as "naked" as the full context is
|
/* The preemptive scheduler is defined as "naked" as the full context is
|
||||||
* saved on entry as part of the context switch. */
|
saved on entry as part of the context switch. */
|
||||||
void vPreemptiveTick( void ) __attribute__((naked));
|
void vPreemptiveTick( void ) __attribute__((naked));
|
||||||
void vPreemptiveTick( void )
|
void vPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -148,7 +148,7 @@ void vPortYieldProcessor( void )
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* if configUSE_PREEMPTION == 0 */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -184,9 +184,9 @@ void vPortEnableInterruptsFromThumb( void )
|
||||||
|
|
||||||
|
|
||||||
/* The code generated by the GCC compiler uses the stack in different ways at
|
/* The code generated by the GCC compiler uses the stack in different ways at
|
||||||
* different optimisation levels. The interrupt flags can therefore not always
|
different optimisation levels. The interrupt flags can therefore not always
|
||||||
* be saved to the stack. Instead the critical section nesting level is stored
|
be saved to the stack. Instead the critical section nesting level is stored
|
||||||
* in a variable, which is then saved as part of the stack context. */
|
in a variable, which is then saved as part of the stack context. */
|
||||||
void vPortEnterCritical( void )
|
void vPortEnterCritical( void )
|
||||||
{
|
{
|
||||||
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
||||||
|
@ -198,8 +198,8 @@ void vPortEnterCritical( void )
|
||||||
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
||||||
|
|
||||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ void vPortExitCritical( void )
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then interrupts should be
|
/* If the nesting level has reached zero then interrupts should be
|
||||||
* re-enabled. */
|
re-enabled. */
|
||||||
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
||||||
|
@ -224,3 +224,4 @@ void vPortExitCritical( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,33 +19,33 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V3.2.3
|
Changes from V3.2.3
|
||||||
*
|
|
||||||
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
||||||
+
|
|
||||||
+ Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
+
|
|
||||||
+ Removed the use of the %0 parameter within the assembler macros and
|
+ Removed the use of the %0 parameter within the assembler macros and
|
||||||
+ replaced them with hard coded registers. This will ensure the
|
replaced them with hard coded registers. This will ensure the
|
||||||
+ assembler does not select the link register as the temp register as
|
assembler does not select the link register as the temp register as
|
||||||
+ was occasionally happening previously.
|
was occasionally happening previously.
|
||||||
+
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
+
|
|
||||||
+ Changes from V4.5.0
|
Changes from V4.5.0
|
||||||
+
|
|
||||||
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
||||||
+ and replaced them with portYIELD_FROM_ISR() macro. Application code
|
and replaced them with portYIELD_FROM_ISR() macro. Application code
|
||||||
+ should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
||||||
+ macros as per the V4.5.1 demo code.
|
macros as per the V4.5.1 demo code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PORTMACRO_H
|
#ifndef PORTMACRO_H
|
||||||
|
@ -246,3 +246,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -78,24 +78,22 @@ extern void vPortISRStartFirstTask( void );
|
||||||
*
|
*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t *pxOriginalTOS;
|
StackType_t *pxOriginalTOS;
|
||||||
|
|
||||||
pxOriginalTOS = pxTopOfStack;
|
pxOriginalTOS = pxTopOfStack;
|
||||||
|
|
||||||
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
||||||
* is not really required. */
|
is not really required. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First on the stack is the return address - which in this case is the
|
/* First on the stack is the return address - which in this case is the
|
||||||
* start of the task. The offset is added to make the return address appear
|
start of the task. The offset is added to make the return address appear
|
||||||
* as it would within an IRQ ISR. */
|
as it would within an IRQ ISR. */
|
||||||
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -129,12 +127,12 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* When the task starts is will expect to find the function parameter in
|
||||||
* R0. */
|
R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The last thing onto the stack is the status register, which is set for
|
/* The last thing onto the stack is the status register, which is set for
|
||||||
* system mode, with interrupts enabled. */
|
system mode, with interrupts enabled. */
|
||||||
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
||||||
|
|
||||||
if( ( ( uint32_t ) pxCode & 0x01UL ) != 0x00 )
|
if( ( ( uint32_t ) pxCode & 0x01UL ) != 0x00 )
|
||||||
|
@ -146,9 +144,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Some optimisation levels use the stack differently to others. This
|
/* Some optimisation levels use the stack differently to others. This
|
||||||
* means the interrupt flags cannot always be stored on the stack and will
|
means the interrupt flags cannot always be stored on the stack and will
|
||||||
* instead be stored in a variable, which is then saved as part of the
|
instead be stored in a variable, which is then saved as part of the
|
||||||
* tasks context. */
|
tasks context. */
|
||||||
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -158,7 +156,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
BaseType_t xPortStartScheduler( void )
|
BaseType_t xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
here already. */
|
||||||
prvSetupTimerInterrupt();
|
prvSetupTimerInterrupt();
|
||||||
|
|
||||||
/* Start the first task. */
|
/* Start the first task. */
|
||||||
|
@ -172,7 +170,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* It is unlikely that the ARM port will require this function as there
|
/* It is unlikely that the ARM port will require this function as there
|
||||||
* is nothing to return to. */
|
is nothing to return to. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -182,18 +180,17 @@ void vPortEndScheduler( void )
|
||||||
static void prvSetupTimerInterrupt( void )
|
static void prvSetupTimerInterrupt( void )
|
||||||
{
|
{
|
||||||
uint32_t ulCompareMatch;
|
uint32_t ulCompareMatch;
|
||||||
|
|
||||||
extern void ( vTickISR )( void );
|
extern void ( vTickISR )( void );
|
||||||
|
|
||||||
/* A 1ms tick does not require the use of the timer prescale. This is
|
/* A 1ms tick does not require the use of the timer prescale. This is
|
||||||
* defaulted to zero but can be used if necessary. */
|
defaulted to zero but can be used if necessary. */
|
||||||
T0_PR = portPRESCALE_VALUE;
|
T0_PR = portPRESCALE_VALUE;
|
||||||
|
|
||||||
/* Calculate the match value required for our wanted tick rate. */
|
/* Calculate the match value required for our wanted tick rate. */
|
||||||
ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
|
ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
|
||||||
|
|
||||||
/* Protect against divide by zero. Using an if() statement still results
|
/* Protect against divide by zero. Using an if() statement still results
|
||||||
* in a warning - hence the #if. */
|
in a warning - hence the #if. */
|
||||||
#if portPRESCALE_VALUE != 0
|
#if portPRESCALE_VALUE != 0
|
||||||
{
|
{
|
||||||
ulCompareMatch /= ( portPRESCALE_VALUE + 1 );
|
ulCompareMatch /= ( portPRESCALE_VALUE + 1 );
|
||||||
|
@ -209,13 +206,16 @@ static void prvSetupTimerInterrupt( void )
|
||||||
VICIntEnable |= portTIMER_VIC_CHANNEL_BIT;
|
VICIntEnable |= portTIMER_VIC_CHANNEL_BIT;
|
||||||
|
|
||||||
/* The ISR installed depends on whether the preemptive or cooperative
|
/* The ISR installed depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
|
|
||||||
VICVectAddr0 = ( int32_t ) vTickISR;
|
VICVectAddr0 = ( int32_t ) vTickISR;
|
||||||
VICVectCntl0 = portTIMER_VIC_CHANNEL | portTIMER_VIC_ENABLE;
|
VICVectCntl0 = portTIMER_VIC_CHANNEL | portTIMER_VIC_ENABLE;
|
||||||
|
|
||||||
/* Start the timer - interrupts are disabled when this function is called
|
/* Start the timer - interrupts are disabled when this function is called
|
||||||
* so it is okay to do this here. */
|
so it is okay to do this here. */
|
||||||
T0_TCR = portENABLE_TIMER;
|
T0_TCR = portENABLE_TIMER;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -33,21 +33,21 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V2.5.2
|
Changes from V2.5.2
|
||||||
*
|
|
||||||
+ The critical section management functions have been changed. These no
|
+ The critical section management functions have been changed. These no
|
||||||
+ longer modify the stack and are safe to use at all optimisation levels.
|
longer modify the stack and are safe to use at all optimisation levels.
|
||||||
+ The functions are now also the same for both ARM and THUMB modes.
|
The functions are now also the same for both ARM and THUMB modes.
|
||||||
+
|
|
||||||
+ Changes from V2.6.0
|
Changes from V2.6.0
|
||||||
+
|
|
||||||
+ Removed the 'static' from the definition of vNonPreemptiveTick() to
|
+ Removed the 'static' from the definition of vNonPreemptiveTick() to
|
||||||
+ allow the demo to link when using the cooperative scheduler.
|
allow the demo to link when using the cooperative scheduler.
|
||||||
+
|
|
||||||
+ Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
+
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ void vPortISRStartFirstTask( void );
|
||||||
void vPortISRStartFirstTask( void )
|
void vPortISRStartFirstTask( void )
|
||||||
{
|
{
|
||||||
/* Simply start the scheduler. This is included here as it can only be
|
/* Simply start the scheduler. This is included here as it can only be
|
||||||
* called from ARM mode. */
|
called from ARM mode. */
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -93,8 +93,8 @@ void vPortISRStartFirstTask( void )
|
||||||
void vPortYieldProcessor( void )
|
void vPortYieldProcessor( void )
|
||||||
{
|
{
|
||||||
/* Within an IRQ ISR the link register has an offset from the true return
|
/* Within an IRQ ISR the link register has an offset from the true return
|
||||||
* address, but an SWI ISR does not. Add the offset manually so the same
|
address, but an SWI ISR does not. Add the offset manually so the same
|
||||||
* ISR return code can be used in both cases. */
|
ISR return code can be used in both cases. */
|
||||||
__asm volatile ( "ADD LR, LR, #4" );
|
__asm volatile ( "ADD LR, LR, #4" );
|
||||||
|
|
||||||
/* Perform the context switch. First save the context of the current task. */
|
/* Perform the context switch. First save the context of the current task. */
|
||||||
|
@ -118,7 +118,7 @@ void vTickISR( void )
|
||||||
portSAVE_CONTEXT();
|
portSAVE_CONTEXT();
|
||||||
|
|
||||||
/* Increment the RTOS tick count, then look for the highest priority
|
/* Increment the RTOS tick count, then look for the highest priority
|
||||||
* task that is ready to run. */
|
task that is ready to run. */
|
||||||
__asm volatile
|
__asm volatile
|
||||||
(
|
(
|
||||||
" bl xTaskIncrementTick \t\n" \
|
" bl xTaskIncrementTick \t\n" \
|
||||||
|
@ -173,9 +173,9 @@ void vTickISR( void )
|
||||||
#endif /* THUMB_INTERWORK */
|
#endif /* THUMB_INTERWORK */
|
||||||
|
|
||||||
/* The code generated by the GCC compiler uses the stack in different ways at
|
/* The code generated by the GCC compiler uses the stack in different ways at
|
||||||
* different optimisation levels. The interrupt flags can therefore not always
|
different optimisation levels. The interrupt flags can therefore not always
|
||||||
* be saved to the stack. Instead the critical section nesting level is stored
|
be saved to the stack. Instead the critical section nesting level is stored
|
||||||
* in a variable, which is then saved as part of the stack context. */
|
in a variable, which is then saved as part of the stack context. */
|
||||||
void vPortEnterCritical( void )
|
void vPortEnterCritical( void )
|
||||||
{
|
{
|
||||||
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
||||||
|
@ -187,8 +187,8 @@ void vPortEnterCritical( void )
|
||||||
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
||||||
|
|
||||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +200,7 @@ void vPortExitCritical( void )
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then interrupts should be
|
/* If the nesting level has reached zero then interrupts should be
|
||||||
* re-enabled. */
|
re-enabled. */
|
||||||
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -223,3 +223,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -78,24 +78,22 @@ extern void vPortISRStartFirstTask( void );
|
||||||
*
|
*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
StackType_t *pxOriginalTOS;
|
StackType_t *pxOriginalTOS;
|
||||||
|
|
||||||
pxOriginalTOS = pxTopOfStack;
|
pxOriginalTOS = pxTopOfStack;
|
||||||
|
|
||||||
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
/* To ensure asserts in tasks.c don't fail, although in this case the assert
|
||||||
* is not really required. */
|
is not really required. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First on the stack is the return address - which in this case is the
|
/* First on the stack is the return address - which in this case is the
|
||||||
* start of the task. The offset is added to make the return address appear
|
start of the task. The offset is added to make the return address appear
|
||||||
* as it would within an IRQ ISR. */
|
as it would within an IRQ ISR. */
|
||||||
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
*pxTopOfStack = ( StackType_t ) pxCode + portINSTRUCTION_SIZE;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
|
@ -129,12 +127,12 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* When the task starts is will expect to find the function parameter in
|
/* When the task starts is will expect to find the function parameter in
|
||||||
* R0. */
|
R0. */
|
||||||
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
*pxTopOfStack = ( StackType_t ) pvParameters; /* R0 */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The last thing onto the stack is the status register, which is set for
|
/* The last thing onto the stack is the status register, which is set for
|
||||||
* system mode, with interrupts enabled. */
|
system mode, with interrupts enabled. */
|
||||||
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
*pxTopOfStack = ( StackType_t ) portINITIAL_SPSR;
|
||||||
|
|
||||||
if( ( ( uint32_t ) pxCode & 0x01UL ) != 0x00 )
|
if( ( ( uint32_t ) pxCode & 0x01UL ) != 0x00 )
|
||||||
|
@ -146,9 +144,9 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* Some optimisation levels use the stack differently to others. This
|
/* Some optimisation levels use the stack differently to others. This
|
||||||
* means the interrupt flags cannot always be stored on the stack and will
|
means the interrupt flags cannot always be stored on the stack and will
|
||||||
* instead be stored in a variable, which is then saved as part of the
|
instead be stored in a variable, which is then saved as part of the
|
||||||
* tasks context. */
|
tasks context. */
|
||||||
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
*pxTopOfStack = portNO_CRITICAL_SECTION_NESTING;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -158,7 +156,7 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
BaseType_t xPortStartScheduler( void )
|
BaseType_t xPortStartScheduler( void )
|
||||||
{
|
{
|
||||||
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
/* Start the timer that generates the tick ISR. Interrupts are disabled
|
||||||
* here already. */
|
here already. */
|
||||||
prvSetupTimerInterrupt();
|
prvSetupTimerInterrupt();
|
||||||
|
|
||||||
/* Start the first task. */
|
/* Start the first task. */
|
||||||
|
@ -172,7 +170,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* It is unlikely that the ARM port will require this function as there
|
/* It is unlikely that the ARM port will require this function as there
|
||||||
* is nothing to return to. */
|
is nothing to return to. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -188,14 +186,14 @@ static void prvSetupTimerInterrupt( void )
|
||||||
T0CTCR = 0; /* Timer mode */
|
T0CTCR = 0; /* Timer mode */
|
||||||
|
|
||||||
/* A 1ms tick does not require the use of the timer prescale. This is
|
/* A 1ms tick does not require the use of the timer prescale. This is
|
||||||
* defaulted to zero but can be used if necessary. */
|
defaulted to zero but can be used if necessary. */
|
||||||
T0PR = portPRESCALE_VALUE;
|
T0PR = portPRESCALE_VALUE;
|
||||||
|
|
||||||
/* Calculate the match value required for our wanted tick rate. */
|
/* Calculate the match value required for our wanted tick rate. */
|
||||||
ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
|
ulCompareMatch = configCPU_CLOCK_HZ / configTICK_RATE_HZ;
|
||||||
|
|
||||||
/* Protect against divide by zero. Using an if() statement still results
|
/* Protect against divide by zero. Using an if() statement still results
|
||||||
* in a warning - hence the #if. */
|
in a warning - hence the #if. */
|
||||||
#if portPRESCALE_VALUE != 0
|
#if portPRESCALE_VALUE != 0
|
||||||
{
|
{
|
||||||
ulCompareMatch /= ( portPRESCALE_VALUE + 1 );
|
ulCompareMatch /= ( portPRESCALE_VALUE + 1 );
|
||||||
|
@ -210,7 +208,7 @@ static void prvSetupTimerInterrupt( void )
|
||||||
VICIntEnable = 0x00000010;
|
VICIntEnable = 0x00000010;
|
||||||
|
|
||||||
/* The ISR installed depends on whether the preemptive or cooperative
|
/* The ISR installed depends on whether the preemptive or cooperative
|
||||||
* scheduler is being used. */
|
scheduler is being used. */
|
||||||
#if configUSE_PREEMPTION == 1
|
#if configUSE_PREEMPTION == 1
|
||||||
{
|
{
|
||||||
extern void ( vPreemptiveTick )( void );
|
extern void ( vPreemptiveTick )( void );
|
||||||
|
@ -226,7 +224,10 @@ static void prvSetupTimerInterrupt( void )
|
||||||
VICVectCntl4 = 1;
|
VICVectCntl4 = 1;
|
||||||
|
|
||||||
/* Start the timer - interrupts are disabled when this function is called
|
/* Start the timer - interrupts are disabled when this function is called
|
||||||
* so it is okay to do this here. */
|
so it is okay to do this here. */
|
||||||
T0TCR = portENABLE_TIMER;
|
T0TCR = portENABLE_TIMER;
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -59,7 +59,7 @@ void vPortISRStartFirstTask( void );
|
||||||
void vPortISRStartFirstTask( void )
|
void vPortISRStartFirstTask( void )
|
||||||
{
|
{
|
||||||
/* Simply start the scheduler. This is included here as it can only be
|
/* Simply start the scheduler. This is included here as it can only be
|
||||||
* called from ARM mode. */
|
called from ARM mode. */
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -75,8 +75,8 @@ void vPortISRStartFirstTask( void )
|
||||||
void vPortYieldProcessor( void )
|
void vPortYieldProcessor( void )
|
||||||
{
|
{
|
||||||
/* Within an IRQ ISR the link register has an offset from the true return
|
/* Within an IRQ ISR the link register has an offset from the true return
|
||||||
* address, but an SWI ISR does not. Add the offset manually so the same
|
address, but an SWI ISR does not. Add the offset manually so the same
|
||||||
* ISR return code can be used in both cases. */
|
ISR return code can be used in both cases. */
|
||||||
__asm volatile ( "ADD LR, LR, #4" );
|
__asm volatile ( "ADD LR, LR, #4" );
|
||||||
|
|
||||||
/* Perform the context switch. First save the context of the current task. */
|
/* Perform the context switch. First save the context of the current task. */
|
||||||
|
@ -99,7 +99,7 @@ void vPortYieldProcessor( void )
|
||||||
#if configUSE_PREEMPTION == 0
|
#if configUSE_PREEMPTION == 0
|
||||||
|
|
||||||
/* The cooperative scheduler requires a normal IRQ service routine to
|
/* The cooperative scheduler requires a normal IRQ service routine to
|
||||||
* simply increment the system tick. */
|
simply increment the system tick. */
|
||||||
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
void vNonPreemptiveTick( void ) __attribute__ ((interrupt ("IRQ")));
|
||||||
void vNonPreemptiveTick( void )
|
void vNonPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -108,10 +108,10 @@ void vPortYieldProcessor( void )
|
||||||
VICVectAddr = portCLEAR_VIC_INTERRUPT;
|
VICVectAddr = portCLEAR_VIC_INTERRUPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* if configUSE_PREEMPTION == 0 */
|
#else
|
||||||
|
|
||||||
/* The preemptive scheduler is defined as "naked" as the full context is
|
/* The preemptive scheduler is defined as "naked" as the full context is
|
||||||
* saved on entry as part of the context switch. */
|
saved on entry as part of the context switch. */
|
||||||
void vPreemptiveTick( void ) __attribute__((naked));
|
void vPreemptiveTick( void ) __attribute__((naked));
|
||||||
void vPreemptiveTick( void )
|
void vPreemptiveTick( void )
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ void vPortYieldProcessor( void )
|
||||||
portSAVE_CONTEXT();
|
portSAVE_CONTEXT();
|
||||||
|
|
||||||
/* Increment the RTOS tick count, then look for the highest priority
|
/* Increment the RTOS tick count, then look for the highest priority
|
||||||
* task that is ready to run. */
|
task that is ready to run. */
|
||||||
__asm volatile
|
__asm volatile
|
||||||
(
|
(
|
||||||
" bl xTaskIncrementTick \t\n" \
|
" bl xTaskIncrementTick \t\n" \
|
||||||
|
@ -137,7 +137,7 @@ void vPortYieldProcessor( void )
|
||||||
portRESTORE_CONTEXT();
|
portRESTORE_CONTEXT();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* if configUSE_PREEMPTION == 0 */
|
#endif
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -176,9 +176,9 @@ void vPortYieldProcessor( void )
|
||||||
#endif /* THUMB_INTERWORK */
|
#endif /* THUMB_INTERWORK */
|
||||||
|
|
||||||
/* The code generated by the GCC compiler uses the stack in different ways at
|
/* The code generated by the GCC compiler uses the stack in different ways at
|
||||||
* different optimisation levels. The interrupt flags can therefore not always
|
different optimisation levels. The interrupt flags can therefore not always
|
||||||
* be saved to the stack. Instead the critical section nesting level is stored
|
be saved to the stack. Instead the critical section nesting level is stored
|
||||||
* in a variable, which is then saved as part of the stack context. */
|
in a variable, which is then saved as part of the stack context. */
|
||||||
void vPortEnterCritical( void )
|
void vPortEnterCritical( void )
|
||||||
{
|
{
|
||||||
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
/* Disable interrupts as per portDISABLE_INTERRUPTS(); */
|
||||||
|
@ -190,8 +190,8 @@ void vPortEnterCritical( void )
|
||||||
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
"LDMIA SP!, {R0}" ); /* Pop R0. */
|
||||||
|
|
||||||
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
/* Now interrupts are disabled ulCriticalNesting can be accessed
|
||||||
* directly. Increment ulCriticalNesting to keep a count of how many times
|
directly. Increment ulCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ulCriticalNesting++;
|
ulCriticalNesting++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,7 +203,7 @@ void vPortExitCritical( void )
|
||||||
ulCriticalNesting--;
|
ulCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then interrupts should be
|
/* If the nesting level has reached zero then interrupts should be
|
||||||
* re-enabled. */
|
re-enabled. */
|
||||||
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
if( ulCriticalNesting == portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
/* Enable interrupts as per portEXIT_CRITICAL(). */
|
||||||
|
|
|
@ -19,33 +19,33 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Changes from V3.2.3
|
Changes from V3.2.3
|
||||||
*
|
|
||||||
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
+ Modified portENTER_SWITCHING_ISR() to allow use with GCC V4.0.1.
|
||||||
+
|
|
||||||
+ Changes from V3.2.4
|
Changes from V3.2.4
|
||||||
+
|
|
||||||
+ Removed the use of the %0 parameter within the assembler macros and
|
+ Removed the use of the %0 parameter within the assembler macros and
|
||||||
+ replaced them with hard coded registers. This will ensure the
|
replaced them with hard coded registers. This will ensure the
|
||||||
+ assembler does not select the link register as the temp register as
|
assembler does not select the link register as the temp register as
|
||||||
+ was occasionally happening previously.
|
was occasionally happening previously.
|
||||||
+
|
|
||||||
+ The assembler statements are now included in a single asm block rather
|
+ The assembler statements are now included in a single asm block rather
|
||||||
+ than each line having its own asm block.
|
than each line having its own asm block.
|
||||||
+
|
|
||||||
+ Changes from V4.5.0
|
Changes from V4.5.0
|
||||||
+
|
|
||||||
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
+ Removed the portENTER_SWITCHING_ISR() and portEXIT_SWITCHING_ISR() macros
|
||||||
+ and replaced them with portYIELD_FROM_ISR() macro. Application code
|
and replaced them with portYIELD_FROM_ISR() macro. Application code
|
||||||
+ should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
should now make use of the portSAVE_CONTEXT() and portRESTORE_CONTEXT()
|
||||||
+ macros as per the V4.5.1 demo code.
|
macros as per the V4.5.1 demo code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef PORTMACRO_H
|
#ifndef PORTMACRO_H
|
||||||
|
@ -246,3 +246,4 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* PORTMACRO_H */
|
#endif /* PORTMACRO_H */
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
* http://www.FreeRTOS.org
|
* https://www.FreeRTOS.org
|
||||||
* http://aws.amazon.com/freertos
|
* https://github.com/FreeRTOS
|
||||||
*
|
*
|
||||||
* 1 tab == 4 spaces!
|
* 1 tab == 4 spaces!
|
||||||
*/
|
*/
|
||||||
|
@ -33,23 +33,23 @@
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
#ifndef configINTERRUPT_CONTROLLER_BASE_ADDRESS
|
#ifndef configINTERRUPT_CONTROLLER_BASE_ADDRESS
|
||||||
#error configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See http: /*www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html */
|
#error configINTERRUPT_CONTROLLER_BASE_ADDRESS must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET
|
#ifndef configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET
|
||||||
#error configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See http: /*www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html */
|
#error configINTERRUPT_CONTROLLER_CPU_INTERFACE_OFFSET must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef configUNIQUE_INTERRUPT_PRIORITIES
|
#ifndef configUNIQUE_INTERRUPT_PRIORITIES
|
||||||
#error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http: /*www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html */
|
#error configUNIQUE_INTERRUPT_PRIORITIES must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef configSETUP_TICK_INTERRUPT
|
#ifndef configSETUP_TICK_INTERRUPT
|
||||||
#error configSETUP_TICK_INTERRUPT() must be defined. See http: /*www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html */
|
#error configSETUP_TICK_INTERRUPT() must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
|
||||||
#endif /* configSETUP_TICK_INTERRUPT */
|
#endif /* configSETUP_TICK_INTERRUPT */
|
||||||
|
|
||||||
#ifndef configMAX_API_CALL_INTERRUPT_PRIORITY
|
#ifndef configMAX_API_CALL_INTERRUPT_PRIORITY
|
||||||
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See http: /*www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html */
|
#error configMAX_API_CALL_INTERRUPT_PRIORITY must be defined. See http://www.freertos.org/Using-FreeRTOS-on-Cortex-A-Embedded-Processors.html
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if configMAX_API_CALL_INTERRUPT_PRIORITY == 0
|
#if configMAX_API_CALL_INTERRUPT_PRIORITY == 0
|
||||||
|
@ -73,24 +73,24 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some vendor specific files default configCLEAR_TICK_INTERRUPT() in
|
/* Some vendor specific files default configCLEAR_TICK_INTERRUPT() in
|
||||||
* portmacro.h. */
|
portmacro.h. */
|
||||||
#ifndef configCLEAR_TICK_INTERRUPT
|
#ifndef configCLEAR_TICK_INTERRUPT
|
||||||
#define configCLEAR_TICK_INTERRUPT()
|
#define configCLEAR_TICK_INTERRUPT()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* A critical section is exited when the critical section nesting count reaches
|
/* A critical section is exited when the critical section nesting count reaches
|
||||||
* this value. */
|
this value. */
|
||||||
#define portNO_CRITICAL_NESTING ( ( size_t ) 0 )
|
#define portNO_CRITICAL_NESTING ( ( size_t ) 0 )
|
||||||
|
|
||||||
/* In all GICs 255 can be written to the priority mask register to unmask all
|
/* In all GICs 255 can be written to the priority mask register to unmask all
|
||||||
* (but the lowest) interrupt priority. */
|
(but the lowest) interrupt priority. */
|
||||||
#define portUNMASK_VALUE ( 0xFFUL )
|
#define portUNMASK_VALUE ( 0xFFUL )
|
||||||
|
|
||||||
/* Tasks are not created with a floating point context, but can be given a
|
/* Tasks are not created with a floating point context, but can be given a
|
||||||
* floating point context after they have been created. A variable is stored as
|
floating point context after they have been created. A variable is stored as
|
||||||
* part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
|
part of the tasks context that holds portNO_FLOATING_POINT_CONTEXT if the task
|
||||||
* does not have an FPU context, or any other value if the task does have an FPU
|
does not have an FPU context, or any other value if the task does have an FPU
|
||||||
* context. */
|
context. */
|
||||||
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
#define portNO_FLOATING_POINT_CONTEXT ( ( StackType_t ) 0 )
|
||||||
|
|
||||||
/* Constants required to setup the initial task context. */
|
/* Constants required to setup the initial task context. */
|
||||||
|
@ -108,7 +108,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
|
/* Used by portASSERT_IF_INTERRUPT_PRIORITY_INVALID() when ensuring the binary
|
||||||
* point is zero. */
|
point is zero. */
|
||||||
#define portBINARY_POINT_BITS ( ( uint8_t ) 0x03 )
|
#define portBINARY_POINT_BITS ( ( uint8_t ) 0x03 )
|
||||||
|
|
||||||
/* Masks all bits in the APSR other than the mode bits. */
|
/* Masks all bits in the APSR other than the mode bits. */
|
||||||
|
@ -143,21 +143,21 @@ extern void vPortRestoreTaskContext( void );
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/* A variable is used to keep track of the critical section nesting. This
|
/* A variable is used to keep track of the critical section nesting. This
|
||||||
* variable has to be stored as part of the task context and must be initialised to
|
variable has to be stored as part of the task context and must be initialised to
|
||||||
* a non zero value to ensure interrupts don't inadvertently become unmasked before
|
a non zero value to ensure interrupts don't inadvertently become unmasked before
|
||||||
* the scheduler starts. As it is stored as part of the task context it will
|
the scheduler starts. As it is stored as part of the task context it will
|
||||||
* automatically be set to 0 when the first task is started. */
|
automatically be set to 0 when the first task is started. */
|
||||||
volatile uint64_t ullCriticalNesting = 9999ULL;
|
volatile uint64_t ullCriticalNesting = 9999ULL;
|
||||||
|
|
||||||
/* Saved as part of the task context. If ullPortTaskHasFPUContext is non-zero
|
/* Saved as part of the task context. If ullPortTaskHasFPUContext is non-zero
|
||||||
* then floating point context must be saved and restored for the task. */
|
then floating point context must be saved and restored for the task. */
|
||||||
uint64_t ullPortTaskHasFPUContext = pdFALSE;
|
uint64_t ullPortTaskHasFPUContext = pdFALSE;
|
||||||
|
|
||||||
/* Set to 1 to pend a context switch from an ISR. */
|
/* Set to 1 to pend a context switch from an ISR. */
|
||||||
uint64_t ullPortYieldRequired = pdFALSE;
|
uint64_t ullPortYieldRequired = pdFALSE;
|
||||||
|
|
||||||
/* Counts the interrupt nesting depth. A context switch is only performed if
|
/* Counts the interrupt nesting depth. A context switch is only performed if
|
||||||
* if the nesting depth is 0. */
|
if the nesting depth is 0. */
|
||||||
uint64_t ullPortInterruptNesting = 0;
|
uint64_t ullPortInterruptNesting = 0;
|
||||||
|
|
||||||
/* Used in the ASM code. */
|
/* Used in the ASM code. */
|
||||||
|
@ -171,12 +171,10 @@ __attribute__( ( used ) ) const uint64_t ullMaxAPIPriorityMask = ( configMAX_API
|
||||||
/*
|
/*
|
||||||
* See header file for description.
|
* See header file for description.
|
||||||
*/
|
*/
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters )
|
||||||
TaskFunction_t pxCode,
|
|
||||||
void * pvParameters )
|
|
||||||
{
|
{
|
||||||
/* Setup the initial stack of the task. The stack is set exactly as
|
/* Setup the initial stack of the task. The stack is set exactly as
|
||||||
* expected by the portRESTORE_CONTEXT() macro. */
|
expected by the portRESTORE_CONTEXT() macro. */
|
||||||
|
|
||||||
/* First all the general purpose registers. */
|
/* First all the general purpose registers. */
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
@ -252,13 +250,13 @@ StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The task will start with a critical nesting count of 0 as interrupts are
|
/* The task will start with a critical nesting count of 0 as interrupts are
|
||||||
* enabled. */
|
enabled. */
|
||||||
*pxTopOfStack = portNO_CRITICAL_NESTING;
|
*pxTopOfStack = portNO_CRITICAL_NESTING;
|
||||||
pxTopOfStack--;
|
pxTopOfStack--;
|
||||||
|
|
||||||
/* The task will start without a floating point context. A task that uses
|
/* The task will start without a floating point context. A task that uses
|
||||||
* the floating point hardware must call vPortTaskUsesFPU() before executing
|
the floating point hardware must call vPortTaskUsesFPU() before executing
|
||||||
* any floating point instructions. */
|
any floating point instructions. */
|
||||||
*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
|
*pxTopOfStack = portNO_FLOATING_POINT_CONTEXT;
|
||||||
|
|
||||||
return pxTopOfStack;
|
return pxTopOfStack;
|
||||||
|
@ -276,12 +274,12 @@ BaseType_t xPortStartScheduler( void )
|
||||||
volatile uint8_t ucMaxPriorityValue;
|
volatile uint8_t ucMaxPriorityValue;
|
||||||
|
|
||||||
/* Determine how many priority bits are implemented in the GIC.
|
/* Determine how many priority bits are implemented in the GIC.
|
||||||
*
|
|
||||||
* Save the interrupt priority value that is about to be clobbered. */
|
Save the interrupt priority value that is about to be clobbered. */
|
||||||
ulOriginalPriority = *pucFirstUserPriorityRegister;
|
ulOriginalPriority = *pucFirstUserPriorityRegister;
|
||||||
|
|
||||||
/* Determine the number of priority bits available. First write to
|
/* Determine the number of priority bits available. First write to
|
||||||
* all possible bits. */
|
all possible bits. */
|
||||||
*pucFirstUserPriorityRegister = portMAX_8_BIT_VALUE;
|
*pucFirstUserPriorityRegister = portMAX_8_BIT_VALUE;
|
||||||
|
|
||||||
/* Read the value back to see how many bits stuck. */
|
/* Read the value back to see how many bits stuck. */
|
||||||
|
@ -294,13 +292,13 @@ BaseType_t xPortStartScheduler( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sanity check configUNIQUE_INTERRUPT_PRIORITIES matches the read
|
/* Sanity check configUNIQUE_INTERRUPT_PRIORITIES matches the read
|
||||||
* value. */
|
value. */
|
||||||
|
|
||||||
configASSERT( ucMaxPriorityValue >= portLOWEST_INTERRUPT_PRIORITY );
|
configASSERT( ucMaxPriorityValue >= portLOWEST_INTERRUPT_PRIORITY );
|
||||||
|
|
||||||
|
|
||||||
/* Restore the clobbered interrupt priority register to its original
|
/* Restore the clobbered interrupt priority register to its original
|
||||||
* value. */
|
value. */
|
||||||
*pucFirstUserPriorityRegister = ulOriginalPriority;
|
*pucFirstUserPriorityRegister = ulOriginalPriority;
|
||||||
}
|
}
|
||||||
#endif /* conifgASSERT_DEFINED */
|
#endif /* conifgASSERT_DEFINED */
|
||||||
|
@ -313,25 +311,23 @@ BaseType_t xPortStartScheduler( void )
|
||||||
#if defined( GUEST )
|
#if defined( GUEST )
|
||||||
#warning Building for execution as a guest under XEN. THIS IS NOT A FULLY TESTED PATH.
|
#warning Building for execution as a guest under XEN. THIS IS NOT A FULLY TESTED PATH.
|
||||||
configASSERT( ulAPSR == portEL1 );
|
configASSERT( ulAPSR == portEL1 );
|
||||||
|
|
||||||
if( ulAPSR == portEL1 )
|
if( ulAPSR == portEL1 )
|
||||||
#else
|
#else
|
||||||
configASSERT( ulAPSR == portEL3 );
|
configASSERT( ulAPSR == portEL3 );
|
||||||
|
|
||||||
if( ulAPSR == portEL3 )
|
if( ulAPSR == portEL3 )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* Only continue if the binary point value is set to its lowest possible
|
/* Only continue if the binary point value is set to its lowest possible
|
||||||
* setting. See the comments in vPortValidateInterruptPriority() below for
|
setting. See the comments in vPortValidateInterruptPriority() below for
|
||||||
* more information. */
|
more information. */
|
||||||
configASSERT( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE );
|
configASSERT( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE );
|
||||||
|
|
||||||
if( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE )
|
if( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE )
|
||||||
{
|
{
|
||||||
/* Interrupts are turned off in the CPU itself to ensure a tick does
|
/* Interrupts are turned off in the CPU itself to ensure a tick does
|
||||||
* not execute while the scheduler is being started. Interrupts are
|
not execute while the scheduler is being started. Interrupts are
|
||||||
* automatically turned back on in the CPU when the first task starts
|
automatically turned back on in the CPU when the first task starts
|
||||||
* executing. */
|
executing. */
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
/* Start the timer that generates the tick ISR. */
|
/* Start the timer that generates the tick ISR. */
|
||||||
|
@ -349,7 +345,7 @@ BaseType_t xPortStartScheduler( void )
|
||||||
void vPortEndScheduler( void )
|
void vPortEndScheduler( void )
|
||||||
{
|
{
|
||||||
/* Not implemented in ports where there is nothing to return to.
|
/* Not implemented in ports where there is nothing to return to.
|
||||||
* Artificially force an assert. */
|
Artificially force an assert. */
|
||||||
configASSERT( ullCriticalNesting == 1000ULL );
|
configASSERT( ullCriticalNesting == 1000ULL );
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
@ -360,15 +356,15 @@ void vPortEnterCritical( void )
|
||||||
uxPortSetInterruptMask();
|
uxPortSetInterruptMask();
|
||||||
|
|
||||||
/* Now interrupts are disabled ullCriticalNesting can be accessed
|
/* Now interrupts are disabled ullCriticalNesting can be accessed
|
||||||
* directly. Increment ullCriticalNesting to keep a count of how many times
|
directly. Increment ullCriticalNesting to keep a count of how many times
|
||||||
* portENTER_CRITICAL() has been called. */
|
portENTER_CRITICAL() has been called. */
|
||||||
ullCriticalNesting++;
|
ullCriticalNesting++;
|
||||||
|
|
||||||
/* This is not the interrupt safe version of the enter critical function so
|
/* This is not the interrupt safe version of the enter critical function so
|
||||||
* assert() if it is being called from an interrupt context. Only API
|
assert() if it is being called from an interrupt context. Only API
|
||||||
* functions that end in "FromISR" can be used in an interrupt. Only assert if
|
functions that end in "FromISR" can be used in an interrupt. Only assert if
|
||||||
* the critical nesting count is 1 to protect against recursive calls if the
|
the critical nesting count is 1 to protect against recursive calls if the
|
||||||
* assert function also uses a critical section. */
|
assert function also uses a critical section. */
|
||||||
if( ullCriticalNesting == 1ULL )
|
if( ullCriticalNesting == 1ULL )
|
||||||
{
|
{
|
||||||
configASSERT( ullPortInterruptNesting == 0 );
|
configASSERT( ullPortInterruptNesting == 0 );
|
||||||
|
@ -381,15 +377,15 @@ void vPortExitCritical( void )
|
||||||
if( ullCriticalNesting > portNO_CRITICAL_NESTING )
|
if( ullCriticalNesting > portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Decrement the nesting count as the critical section is being
|
/* Decrement the nesting count as the critical section is being
|
||||||
* exited. */
|
exited. */
|
||||||
ullCriticalNesting--;
|
ullCriticalNesting--;
|
||||||
|
|
||||||
/* If the nesting level has reached zero then all interrupt
|
/* If the nesting level has reached zero then all interrupt
|
||||||
* priorities must be re-enabled. */
|
priorities must be re-enabled. */
|
||||||
if( ullCriticalNesting == portNO_CRITICAL_NESTING )
|
if( ullCriticalNesting == portNO_CRITICAL_NESTING )
|
||||||
{
|
{
|
||||||
/* Critical nesting has reached zero so all interrupt priorities
|
/* Critical nesting has reached zero so all interrupt priorities
|
||||||
* should be unmasked. */
|
should be unmasked. */
|
||||||
portCLEAR_INTERRUPT_MASK();
|
portCLEAR_INTERRUPT_MASK();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -416,10 +412,10 @@ void FreeRTOS_Tick_Handler( void )
|
||||||
#endif /* configASSERT_DEFINED */
|
#endif /* configASSERT_DEFINED */
|
||||||
|
|
||||||
/* Set interrupt mask before altering scheduler structures. The tick
|
/* Set interrupt mask before altering scheduler structures. The tick
|
||||||
* handler runs at the lowest priority, so interrupts cannot already be masked,
|
handler runs at the lowest priority, so interrupts cannot already be masked,
|
||||||
* so there is no need to save and restore the current mask value. It is
|
so there is no need to save and restore the current mask value. It is
|
||||||
* necessary to turn off interrupts in the CPU itself while the ICCPMR is being
|
necessary to turn off interrupts in the CPU itself while the ICCPMR is being
|
||||||
* updated. */
|
updated. */
|
||||||
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
portICCPMR_PRIORITY_MASK_REGISTER = ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT );
|
||||||
__asm volatile ( "dsb sy \n"
|
__asm volatile ( "dsb sy \n"
|
||||||
"isb sy \n" ::: "memory" );
|
"isb sy \n" ::: "memory" );
|
||||||
|
@ -442,11 +438,11 @@ void FreeRTOS_Tick_Handler( void )
|
||||||
void vPortTaskUsesFPU( void )
|
void vPortTaskUsesFPU( void )
|
||||||
{
|
{
|
||||||
/* A task is registering the fact that it needs an FPU context. Set the
|
/* A task is registering the fact that it needs an FPU context. Set the
|
||||||
* FPU flag (which is saved as part of the task context). */
|
FPU flag (which is saved as part of the task context). */
|
||||||
ullPortTaskHasFPUContext = pdTRUE;
|
ullPortTaskHasFPUContext = pdTRUE;
|
||||||
|
|
||||||
/* Consider initialising the FPSR here - but probably not necessary in
|
/* Consider initialising the FPSR here - but probably not necessary in
|
||||||
* AArch64. */
|
AArch64. */
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -464,9 +460,8 @@ UBaseType_t uxPortSetInterruptMask( void )
|
||||||
uint32_t ulReturn;
|
uint32_t ulReturn;
|
||||||
|
|
||||||
/* Interrupt in the CPU must be turned off while the ICCPMR is being
|
/* Interrupt in the CPU must be turned off while the ICCPMR is being
|
||||||
* updated. */
|
updated. */
|
||||||
portDISABLE_INTERRUPTS();
|
portDISABLE_INTERRUPTS();
|
||||||
|
|
||||||
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
if( portICCPMR_PRIORITY_MASK_REGISTER == ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) )
|
||||||
{
|
{
|
||||||
/* Interrupts were already masked. */
|
/* Interrupts were already masked. */
|
||||||
|
@ -479,7 +474,6 @@ UBaseType_t uxPortSetInterruptMask( void )
|
||||||
__asm volatile ( "dsb sy \n"
|
__asm volatile ( "dsb sy \n"
|
||||||
"isb sy \n" ::: "memory" );
|
"isb sy \n" ::: "memory" );
|
||||||
}
|
}
|
||||||
|
|
||||||
portENABLE_INTERRUPTS();
|
portENABLE_INTERRUPTS();
|
||||||
|
|
||||||
return ulReturn;
|
return ulReturn;
|
||||||
|
@ -491,33 +485,34 @@ UBaseType_t uxPortSetInterruptMask( void )
|
||||||
void vPortValidateInterruptPriority( void )
|
void vPortValidateInterruptPriority( void )
|
||||||
{
|
{
|
||||||
/* The following assertion will fail if a service routine (ISR) for
|
/* The following assertion will fail if a service routine (ISR) for
|
||||||
* an interrupt that has been assigned a priority above
|
an interrupt that has been assigned a priority above
|
||||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
|
configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
|
||||||
* function. ISR safe FreeRTOS API functions must *only* be called
|
function. ISR safe FreeRTOS API functions must *only* be called
|
||||||
* from interrupts that have been assigned a priority at or below
|
from interrupts that have been assigned a priority at or below
|
||||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
||||||
*
|
|
||||||
* Numerically low interrupt priority numbers represent logically high
|
Numerically low interrupt priority numbers represent logically high
|
||||||
* interrupt priorities, therefore the priority of the interrupt must
|
interrupt priorities, therefore the priority of the interrupt must
|
||||||
* be set to a value equal to or numerically *higher* than
|
be set to a value equal to or numerically *higher* than
|
||||||
* configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
configMAX_SYSCALL_INTERRUPT_PRIORITY.
|
||||||
*
|
|
||||||
* FreeRTOS maintains separate thread and ISR API functions to ensure
|
FreeRTOS maintains separate thread and ISR API functions to ensure
|
||||||
* interrupt entry is as fast and simple as possible. */
|
interrupt entry is as fast and simple as possible. */
|
||||||
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
configASSERT( portICCRPR_RUNNING_PRIORITY_REGISTER >= ( uint32_t ) ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT ) );
|
||||||
|
|
||||||
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
/* Priority grouping: The interrupt controller (GIC) allows the bits
|
||||||
* that define each interrupt's priority to be split between bits that
|
that define each interrupt's priority to be split between bits that
|
||||||
* define the interrupt's pre-emption priority bits and bits that define
|
define the interrupt's pre-emption priority bits and bits that define
|
||||||
* the interrupt's sub-priority. For simplicity all bits must be defined
|
the interrupt's sub-priority. For simplicity all bits must be defined
|
||||||
* to be pre-emption priority bits. The following assertion will fail if
|
to be pre-emption priority bits. The following assertion will fail if
|
||||||
* this is not the case (if some bits represent a sub-priority).
|
this is not the case (if some bits represent a sub-priority).
|
||||||
*
|
|
||||||
* The priority grouping is configured by the GIC's binary point register
|
The priority grouping is configured by the GIC's binary point register
|
||||||
* (ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
|
(ICCBPR). Writting 0 to ICCBPR will ensure it is set to its lowest
|
||||||
* possible value (which may be above 0). */
|
possible value (which may be above 0). */
|
||||||
configASSERT( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE );
|
configASSERT( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* configASSERT_DEFINED */
|
#endif /* configASSERT_DEFINED */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue