mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Style: Uncrustify kernel file - remove tab == 4 spaces (#123)
* Style: uncrystify kernel files and remove tabs * Style: uncrystify kernel files and remove tabs Co-authored-by: Alfred Gedeon <gedeonag@amazon.com>
This commit is contained in:
parent
386d854e0b
commit
9a1ebfec31
1620
include/FreeRTOS.h
1620
include/FreeRTOS.h
File diff suppressed because it is too large
Load diff
326
include/atomic.h
326
include/atomic.h
|
@ -34,18 +34,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef ATOMIC_H
|
#ifndef ATOMIC_H
|
||||||
#define ATOMIC_H
|
#define ATOMIC_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h must appear in source files before include atomic.h"
|
#error "include FreeRTOS.h must appear in source files before include atomic.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Standard includes. */
|
/* Standard includes. */
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Port specific definitions -- entering/exiting critical section.
|
* Port specific definitions -- entering/exiting critical section.
|
||||||
|
@ -55,22 +57,22 @@
|
||||||
* ATOMIC_ENTER_CRITICAL().
|
* ATOMIC_ENTER_CRITICAL().
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
|
#if defined( portSET_INTERRUPT_MASK_FROM_ISR )
|
||||||
|
|
||||||
/* Nested interrupt scheme is supported in this port. */
|
/* Nested interrupt scheme is supported in this port. */
|
||||||
#define ATOMIC_ENTER_CRITICAL() \
|
#define ATOMIC_ENTER_CRITICAL() \
|
||||||
UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
|
UBaseType_t uxCriticalSectionType = portSET_INTERRUPT_MASK_FROM_ISR()
|
||||||
|
|
||||||
#define ATOMIC_EXIT_CRITICAL() \
|
#define ATOMIC_EXIT_CRITICAL() \
|
||||||
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
|
portCLEAR_INTERRUPT_MASK_FROM_ISR( uxCriticalSectionType )
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
/* Nested interrupt scheme is NOT supported in this port. */
|
/* Nested interrupt scheme is NOT supported in this port. */
|
||||||
#define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
|
#define ATOMIC_ENTER_CRITICAL() portENTER_CRITICAL()
|
||||||
#define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
|
#define ATOMIC_EXIT_CRITICAL() portEXIT_CRITICAL()
|
||||||
|
|
||||||
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
|
#endif /* portSET_INTERRUPT_MASK_FROM_ISR() */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Port specific definition -- "always inline".
|
* Port specific definition -- "always inline".
|
||||||
|
@ -79,12 +81,12 @@
|
||||||
* for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
|
* for atomic. Thus, if portFORCE_INLINE is not provided by portmacro.h,
|
||||||
* instead of resulting error, simply define it away.
|
* instead of resulting error, simply define it away.
|
||||||
*/
|
*/
|
||||||
#ifndef portFORCE_INLINE
|
#ifndef portFORCE_INLINE
|
||||||
#define portFORCE_INLINE
|
#define portFORCE_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
|
#define ATOMIC_COMPARE_AND_SWAP_SUCCESS 0x1U /**< Compare and swap succeeded, swapped. */
|
||||||
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
|
#define ATOMIC_COMPARE_AND_SWAP_FAILURE 0x0U /**< Compare and swap failed, did not swap. */
|
||||||
|
|
||||||
/*----------------------------- Swap && CAS ------------------------------*/
|
/*----------------------------- Swap && CAS ------------------------------*/
|
||||||
|
|
||||||
|
@ -103,28 +105,28 @@
|
||||||
* @note This function only swaps *pulDestination with ulExchange, if previous
|
* @note This function only swaps *pulDestination with ulExchange, if previous
|
||||||
* *pulDestination value equals ulComparand.
|
* *pulDestination value equals ulComparand.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_CompareAndSwap_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulExchange,
|
uint32_t ulExchange,
|
||||||
uint32_t ulComparand )
|
uint32_t ulComparand )
|
||||||
|
{
|
||||||
|
uint32_t ulReturnValue;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulReturnValue;
|
if( *pulDestination == ulComparand )
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
{
|
||||||
if( *pulDestination == ulComparand )
|
*pulDestination = ulExchange;
|
||||||
{
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
||||||
*pulDestination = ulExchange;
|
}
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
else
|
||||||
}
|
{
|
||||||
else
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
||||||
{
|
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulReturnValue;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulReturnValue;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,20 +141,20 @@
|
||||||
*
|
*
|
||||||
* @return The initial value of *ppvDestination.
|
* @return The initial value of *ppvDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
|
static portFORCE_INLINE void * Atomic_SwapPointers_p32( void * volatile * ppvDestination,
|
||||||
void * pvExchange )
|
void * pvExchange )
|
||||||
|
{
|
||||||
|
void * pReturnValue;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
void * pReturnValue;
|
pReturnValue = *ppvDestination;
|
||||||
|
*ppvDestination = pvExchange;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
pReturnValue = *ppvDestination;
|
|
||||||
*ppvDestination = pvExchange;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return pReturnValue;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return pReturnValue;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,24 +173,24 @@
|
||||||
* @note This function only swaps *ppvDestination with pvExchange, if previous
|
* @note This function only swaps *ppvDestination with pvExchange, if previous
|
||||||
* *ppvDestination value equals pvComparand.
|
* *ppvDestination value equals pvComparand.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
|
static portFORCE_INLINE uint32_t Atomic_CompareAndSwapPointers_p32( void * volatile * ppvDestination,
|
||||||
void * pvExchange,
|
void * pvExchange,
|
||||||
void * pvComparand )
|
void * pvComparand )
|
||||||
|
{
|
||||||
|
uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulReturnValue = ATOMIC_COMPARE_AND_SWAP_FAILURE;
|
if( *ppvDestination == pvComparand )
|
||||||
|
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
{
|
||||||
if( *ppvDestination == pvComparand )
|
*ppvDestination = pvExchange;
|
||||||
{
|
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
||||||
*ppvDestination = pvExchange;
|
|
||||||
ulReturnValue = ATOMIC_COMPARE_AND_SWAP_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulReturnValue;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulReturnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------- Arithmetic ------------------------------*/
|
/*----------------------------- Arithmetic ------------------------------*/
|
||||||
|
@ -204,20 +206,20 @@
|
||||||
*
|
*
|
||||||
* @return previous *pulAddend value.
|
* @return previous *pulAddend value.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
|
static portFORCE_INLINE uint32_t Atomic_Add_u32( uint32_t volatile * pulAddend,
|
||||||
uint32_t ulCount )
|
uint32_t ulCount )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulAddend;
|
||||||
|
*pulAddend += ulCount;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulAddend;
|
|
||||||
*pulAddend += ulCount;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -232,20 +234,20 @@
|
||||||
*
|
*
|
||||||
* @return previous *pulAddend value.
|
* @return previous *pulAddend value.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
|
static portFORCE_INLINE uint32_t Atomic_Subtract_u32( uint32_t volatile * pulAddend,
|
||||||
uint32_t ulCount )
|
uint32_t ulCount )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulAddend;
|
||||||
|
*pulAddend -= ulCount;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulAddend;
|
|
||||||
*pulAddend -= ulCount;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -258,19 +260,19 @@
|
||||||
*
|
*
|
||||||
* @return *pulAddend value before increment.
|
* @return *pulAddend value before increment.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
|
static portFORCE_INLINE uint32_t Atomic_Increment_u32( uint32_t volatile * pulAddend )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulAddend;
|
||||||
|
*pulAddend += 1;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulAddend;
|
|
||||||
*pulAddend += 1;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,19 +285,19 @@
|
||||||
*
|
*
|
||||||
* @return *pulAddend value before decrement.
|
* @return *pulAddend value before decrement.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
|
static portFORCE_INLINE uint32_t Atomic_Decrement_u32( uint32_t volatile * pulAddend )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulAddend;
|
||||||
|
*pulAddend -= 1;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulAddend;
|
|
||||||
*pulAddend -= 1;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------- Bitwise Logical ------------------------------*/
|
/*----------------------------- Bitwise Logical ------------------------------*/
|
||||||
|
|
||||||
|
@ -310,20 +312,20 @@
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_OR_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulDestination;
|
||||||
|
*pulDestination |= ulValue;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulDestination;
|
|
||||||
*pulDestination |= ulValue;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -337,20 +339,20 @@
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_AND_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulDestination;
|
||||||
|
*pulDestination &= ulValue;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulDestination;
|
|
||||||
*pulDestination &= ulValue;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -364,20 +366,20 @@
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_NAND_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulDestination;
|
||||||
|
*pulDestination = ~( ulCurrent & ulValue );
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulDestination;
|
|
||||||
*pulDestination = ~( ulCurrent & ulValue );
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
|
return ulCurrent;
|
||||||
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -391,23 +393,25 @@
|
||||||
*
|
*
|
||||||
* @return The original value of *pulDestination.
|
* @return The original value of *pulDestination.
|
||||||
*/
|
*/
|
||||||
static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
|
static portFORCE_INLINE uint32_t Atomic_XOR_u32( uint32_t volatile * pulDestination,
|
||||||
uint32_t ulValue )
|
uint32_t ulValue )
|
||||||
|
{
|
||||||
|
uint32_t ulCurrent;
|
||||||
|
|
||||||
|
ATOMIC_ENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uint32_t ulCurrent;
|
ulCurrent = *pulDestination;
|
||||||
|
*pulDestination ^= ulValue;
|
||||||
ATOMIC_ENTER_CRITICAL();
|
|
||||||
{
|
|
||||||
ulCurrent = *pulDestination;
|
|
||||||
*pulDestination ^= ulValue;
|
|
||||||
}
|
|
||||||
ATOMIC_EXIT_CRITICAL();
|
|
||||||
|
|
||||||
return ulCurrent;
|
|
||||||
}
|
}
|
||||||
|
ATOMIC_EXIT_CRITICAL();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
return ulCurrent;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
/* *INDENT-OFF* */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ATOMIC_H */
|
#endif /* ATOMIC_H */
|
||||||
|
|
|
@ -25,36 +25,38 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CO_ROUTINE_H
|
#ifndef CO_ROUTINE_H
|
||||||
#define CO_ROUTINE_H
|
#define CO_ROUTINE_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h must appear in source files before include croutine.h"
|
#error "include FreeRTOS.h must appear in source files before include croutine.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "list.h"
|
#include "list.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#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
|
||||||
* the macro implementation of the co-routine functionality. */
|
* the macro implementation of the co-routine functionality. */
|
||||||
typedef void * CoRoutineHandle_t;
|
typedef void * CoRoutineHandle_t;
|
||||||
|
|
||||||
/* Defines the prototype to which co-routine functions must conform. */
|
/* Defines the prototype to which co-routine functions must conform. */
|
||||||
typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
|
typedef void (* crCOROUTINE_CODE)( CoRoutineHandle_t,
|
||||||
UBaseType_t );
|
UBaseType_t );
|
||||||
|
|
||||||
typedef struct corCoRoutineControlBlock
|
typedef struct corCoRoutineControlBlock
|
||||||
{
|
{
|
||||||
crCOROUTINE_CODE pxCoRoutineFunction;
|
crCOROUTINE_CODE pxCoRoutineFunction;
|
||||||
ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
|
ListItem_t xGenericListItem; /*< List item used to place the CRCB in ready and blocked queues. */
|
||||||
ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */
|
ListItem_t xEventListItem; /*< List item used to place the CRCB in event lists. */
|
||||||
UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
|
UBaseType_t uxPriority; /*< The priority of the co-routine in relation to other co-routines. */
|
||||||
UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
|
UBaseType_t uxIndex; /*< Used to distinguish between co-routines when multiple co-routines use the same co-routine function. */
|
||||||
uint16_t uxState; /*< Used internally by the co-routine implementation. */
|
uint16_t uxState; /*< Used internally by the co-routine implementation. */
|
||||||
} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */
|
} CRCB_t; /* Co-routine control block. Note must be identical in size down to uxPriority with TCB_t. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
|
@ -128,9 +130,9 @@
|
||||||
* \defgroup xCoRoutineCreate xCoRoutineCreate
|
* \defgroup xCoRoutineCreate xCoRoutineCreate
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
BaseType_t xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode,
|
||||||
UBaseType_t uxPriority,
|
UBaseType_t uxPriority,
|
||||||
UBaseType_t uxIndex );
|
UBaseType_t uxIndex );
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,7 +174,7 @@
|
||||||
* \defgroup vCoRoutineSchedule vCoRoutineSchedule
|
* \defgroup vCoRoutineSchedule vCoRoutineSchedule
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
void vCoRoutineSchedule( void );
|
void vCoRoutineSchedule( void );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* croutine. h
|
* croutine. h
|
||||||
|
@ -203,7 +205,7 @@
|
||||||
* \defgroup crSTART crSTART
|
* \defgroup crSTART crSTART
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crSTART( pxCRCB ) \
|
#define crSTART( pxCRCB ) \
|
||||||
switch( ( ( CRCB_t * ) ( pxCRCB ) )->uxState ) { \
|
switch( ( ( CRCB_t * ) ( pxCRCB ) )->uxState ) { \
|
||||||
case 0:
|
case 0:
|
||||||
|
|
||||||
|
@ -236,16 +238,16 @@
|
||||||
* \defgroup crSTART crSTART
|
* \defgroup crSTART crSTART
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crEND() }
|
#define crEND() }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* These macros are intended for internal use by the co-routine implementation
|
* These macros are intended for internal use by the co-routine implementation
|
||||||
* only. The macros should not be used directly by application writers.
|
* only. The macros should not be used directly by application writers.
|
||||||
*/
|
*/
|
||||||
#define crSET_STATE0( xHandle ) \
|
#define crSET_STATE0( xHandle ) \
|
||||||
( ( CRCB_t * ) ( xHandle ) )->uxState = ( __LINE__ * 2 ); return; \
|
( ( CRCB_t * ) ( xHandle ) )->uxState = ( __LINE__ * 2 ); return; \
|
||||||
case ( __LINE__ * 2 ):
|
case ( __LINE__ * 2 ):
|
||||||
#define crSET_STATE1( xHandle ) \
|
#define crSET_STATE1( xHandle ) \
|
||||||
( ( CRCB_t * ) ( xHandle ) )->uxState = ( ( __LINE__ * 2 ) + 1 ); return; \
|
( ( CRCB_t * ) ( xHandle ) )->uxState = ( ( __LINE__ * 2 ) + 1 ); return; \
|
||||||
case ( ( __LINE__ * 2 ) + 1 ):
|
case ( ( __LINE__ * 2 ) + 1 ):
|
||||||
|
|
||||||
|
@ -295,7 +297,7 @@
|
||||||
* \defgroup crDELAY crDELAY
|
* \defgroup crDELAY crDELAY
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crDELAY( xHandle, xTicksToDelay ) \
|
#define crDELAY( xHandle, xTicksToDelay ) \
|
||||||
if( ( xTicksToDelay ) > 0 ) \
|
if( ( xTicksToDelay ) > 0 ) \
|
||||||
{ \
|
{ \
|
||||||
vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
|
vCoRoutineAddToDelayedList( ( xTicksToDelay ), NULL ); \
|
||||||
|
@ -385,7 +387,7 @@
|
||||||
* \defgroup crQUEUE_SEND crQUEUE_SEND
|
* \defgroup crQUEUE_SEND crQUEUE_SEND
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
|
#define crQUEUE_SEND( xHandle, pxQueue, pvItemToQueue, xTicksToWait, pxResult ) \
|
||||||
{ \
|
{ \
|
||||||
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
|
*( pxResult ) = xQueueCRSend( ( pxQueue ), ( pvItemToQueue ), ( xTicksToWait ) ); \
|
||||||
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
||||||
|
@ -477,7 +479,7 @@
|
||||||
* \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
|
* \defgroup crQUEUE_RECEIVE crQUEUE_RECEIVE
|
||||||
* \ingroup Tasks
|
* \ingroup Tasks
|
||||||
*/
|
*/
|
||||||
#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
|
#define crQUEUE_RECEIVE( xHandle, pxQueue, pvBuffer, xTicksToWait, pxResult ) \
|
||||||
{ \
|
{ \
|
||||||
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
|
*( pxResult ) = xQueueCRReceive( ( pxQueue ), ( pvBuffer ), ( xTicksToWait ) ); \
|
||||||
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
if( *( pxResult ) == errQUEUE_BLOCKED ) \
|
||||||
|
@ -586,7 +588,8 @@
|
||||||
* \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 ) )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -699,7 +702,8 @@
|
||||||
* \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.
|
||||||
|
@ -710,8 +714,8 @@
|
||||||
* Removes the current co-routine from its ready list and places it in the
|
* Removes the current co-routine from its ready list and places it in the
|
||||||
* appropriate delayed list.
|
* appropriate delayed list.
|
||||||
*/
|
*/
|
||||||
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
|
void vCoRoutineAddToDelayedList( TickType_t xTicksToDelay,
|
||||||
List_t * pxEventList );
|
List_t * pxEventList );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is intended for internal use by the queue implementation only.
|
* This function is intended for internal use by the queue implementation only.
|
||||||
|
@ -720,10 +724,12 @@
|
||||||
* Removes the highest priority co-routine from the event list and places it in
|
* Removes the highest priority co-routine from the event list and places it in
|
||||||
* the pending ready list.
|
* the pending ready list.
|
||||||
*/
|
*/
|
||||||
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
|
BaseType_t xCoRoutineRemoveFromEventList( const List_t * pxEventList );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* CO_ROUTINE_H */
|
#endif /* CO_ROUTINE_H */
|
||||||
|
|
|
@ -25,18 +25,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef EVENT_GROUPS_H
|
#ifndef EVENT_GROUPS_H
|
||||||
#define EVENT_GROUPS_H
|
#define EVENT_GROUPS_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
|
#error "include FreeRTOS.h" must appear in source files before "include event_groups.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* FreeRTOS includes. */
|
/* FreeRTOS includes. */
|
||||||
#include "timers.h"
|
#include "timers.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#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
|
||||||
|
@ -77,8 +79,8 @@
|
||||||
* \defgroup EventGroupHandle_t EventGroupHandle_t
|
* \defgroup EventGroupHandle_t EventGroupHandle_t
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
struct EventGroupDef_t;
|
struct EventGroupDef_t;
|
||||||
typedef struct EventGroupDef_t * EventGroupHandle_t;
|
typedef struct EventGroupDef_t * EventGroupHandle_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The type that holds event bits always matches TickType_t - therefore the
|
* The type that holds event bits always matches TickType_t - therefore the
|
||||||
|
@ -88,7 +90,7 @@
|
||||||
* \defgroup EventBits_t EventBits_t
|
* \defgroup EventBits_t EventBits_t
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
typedef TickType_t EventBits_t;
|
typedef TickType_t EventBits_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -142,9 +144,9 @@
|
||||||
* \defgroup xEventGroupCreate xEventGroupCreate
|
* \defgroup xEventGroupCreate xEventGroupCreate
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||||
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
|
EventGroupHandle_t xEventGroupCreate( void ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -195,9 +197,9 @@
|
||||||
* xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
* xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
EventGroupHandle_t xEventGroupCreateStatic( StaticEventGroup_t * pxEventGroupBuffer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -291,11 +293,11 @@
|
||||||
* \defgroup xEventGroupWaitBits xEventGroupWaitBits
|
* \defgroup xEventGroupWaitBits xEventGroupWaitBits
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToWaitFor,
|
const EventBits_t uxBitsToWaitFor,
|
||||||
const BaseType_t xClearOnExit,
|
const BaseType_t xClearOnExit,
|
||||||
const BaseType_t xWaitForAllBits,
|
const BaseType_t xWaitForAllBits,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -352,8 +354,8 @@
|
||||||
* \defgroup xEventGroupClearBits xEventGroupClearBits
|
* \defgroup xEventGroupClearBits xEventGroupClearBits
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
EventBits_t xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
const EventBits_t uxBitsToClear ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -408,12 +410,13 @@
|
||||||
* \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
|
* \defgroup xEventGroupClearBitsFromISR xEventGroupClearBitsFromISR
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
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 ) \
|
||||||
#endif
|
xTimerPendFunctionCallFromISR( vEventGroupClearBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToClear, NULL )
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -487,8 +490,8 @@
|
||||||
* \defgroup xEventGroupSetBits xEventGroupSetBits
|
* \defgroup xEventGroupSetBits xEventGroupSetBits
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
EventBits_t xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
|
const EventBits_t uxBitsToSet ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -562,13 +565,14 @@
|
||||||
* \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
|
* \defgroup xEventGroupSetBitsFromISR xEventGroupSetBitsFromISR
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
|
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
|
||||||
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 ) \
|
||||||
#endif
|
xTimerPendFunctionCallFromISR( vEventGroupSetBitsCallback, ( void * ) xEventGroup, ( uint32_t ) uxBitsToSet, pxHigherPriorityTaskWoken )
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -618,9 +622,9 @@
|
||||||
* Example usage:
|
* Example usage:
|
||||||
* <pre>
|
* <pre>
|
||||||
* // Bits used by the three tasks.
|
* // Bits used by the three tasks.
|
||||||
#define TASK_0_BIT ( 1 << 0 )
|
#define TASK_0_BIT ( 1 << 0 )
|
||||||
#define TASK_1_BIT ( 1 << 1 )
|
#define TASK_1_BIT ( 1 << 1 )
|
||||||
#define TASK_2_BIT ( 1 << 2 )
|
#define TASK_2_BIT ( 1 << 2 )
|
||||||
*
|
*
|
||||||
#define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
|
#define ALL_SYNC_BITS ( TASK_0_BIT | TASK_1_BIT | TASK_2_BIT )
|
||||||
*
|
*
|
||||||
|
@ -694,10 +698,10 @@
|
||||||
* \defgroup xEventGroupSync xEventGroupSync
|
* \defgroup xEventGroupSync xEventGroupSync
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||||
const EventBits_t uxBitsToSet,
|
const EventBits_t uxBitsToSet,
|
||||||
const EventBits_t uxBitsToWaitFor,
|
const EventBits_t uxBitsToWaitFor,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -716,7 +720,7 @@
|
||||||
* \defgroup xEventGroupGetBits xEventGroupGetBits
|
* \defgroup xEventGroupGetBits xEventGroupGetBits
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
|
#define xEventGroupGetBits( xEventGroup ) xEventGroupClearBits( xEventGroup, 0 )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -733,7 +737,7 @@
|
||||||
* \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
|
* \defgroup xEventGroupGetBitsFromISR xEventGroupGetBitsFromISR
|
||||||
* \ingroup EventGroup
|
* \ingroup EventGroup
|
||||||
*/
|
*/
|
||||||
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
EventBits_t xEventGroupGetBitsFromISR( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* event_groups.h
|
* event_groups.h
|
||||||
|
@ -747,23 +751,25 @@
|
||||||
*
|
*
|
||||||
* @param xEventGroup The event group being deleted.
|
* @param xEventGroup The event group being deleted.
|
||||||
*/
|
*/
|
||||||
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
void vEventGroupDelete( EventGroupHandle_t xEventGroup ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/* For internal use only. */
|
/* For internal use only. */
|
||||||
void vEventGroupSetBitsCallback( void * pvEventGroup,
|
void vEventGroupSetBitsCallback( void * pvEventGroup,
|
||||||
const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
|
const uint32_t ulBitsToSet ) PRIVILEGED_FUNCTION;
|
||||||
void vEventGroupClearBitsCallback( void * pvEventGroup,
|
void vEventGroupClearBitsCallback( void * pvEventGroup,
|
||||||
const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
const uint32_t ulBitsToClear ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
UBaseType_t uxEventGroupGetNumber( void * xEventGroup ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxEventGroupGetNumber( void * xEventGroup ) PRIVILEGED_FUNCTION;
|
||||||
void vEventGroupSetNumber( void * xEventGroup,
|
void vEventGroupSetNumber( void * xEventGroup,
|
||||||
UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxEventGroupNumber ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* EVENT_GROUPS_H */
|
#endif /* EVENT_GROUPS_H */
|
||||||
|
|
181
include/list.h
181
include/list.h
|
@ -52,12 +52,13 @@
|
||||||
* \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
|
||||||
|
@ -87,87 +88,89 @@
|
||||||
* FreeRTOSConfig.h (without the quotes):
|
* FreeRTOSConfig.h (without the quotes):
|
||||||
* "#define configLIST_VOLATILE volatile"
|
* "#define configLIST_VOLATILE volatile"
|
||||||
*/
|
*/
|
||||||
#ifndef configLIST_VOLATILE
|
#ifndef configLIST_VOLATILE
|
||||||
#define configLIST_VOLATILE
|
#define configLIST_VOLATILE
|
||||||
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
#endif /* configSUPPORT_CROSS_MODULE_OPTIMISATION */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#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
|
||||||
* the application. These may catch the list data structures being overwritten in
|
* the application. These may catch the list data structures being overwritten in
|
||||||
* memory. They will not catch data errors caused by incorrect configuration or
|
* memory. They will not catch data errors caused by incorrect configuration or
|
||||||
* use of FreeRTOS.*/
|
* use of FreeRTOS.*/
|
||||||
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
|
#if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 )
|
||||||
/* Define the macros to do nothing. */
|
/* Define the macros to do nothing. */
|
||||||
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
||||||
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE
|
||||||
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE
|
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE
|
||||||
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE
|
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE
|
||||||
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
||||||
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem )
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
|
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList )
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
|
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList )
|
||||||
#define listTEST_LIST_ITEM_INTEGRITY( pxItem )
|
#define listTEST_LIST_ITEM_INTEGRITY( pxItem )
|
||||||
#define listTEST_LIST_INTEGRITY( pxList )
|
#define listTEST_LIST_INTEGRITY( pxList )
|
||||||
#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
|
#else /* if ( configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES == 0 ) */
|
||||||
/* Define macros that add new members into the list structures. */
|
/* Define macros that add new members into the list structures. */
|
||||||
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
|
#define listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue1;
|
||||||
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
|
#define listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE TickType_t xListItemIntegrityValue2;
|
||||||
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
|
#define listFIRST_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue1;
|
||||||
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
|
#define listSECOND_LIST_INTEGRITY_CHECK_VALUE TickType_t xListIntegrityValue2;
|
||||||
|
|
||||||
/* Define macros that set the new structure members to known values. */
|
/* Define macros that set the new structure members to known values. */
|
||||||
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ) ( pxItem )->xListItemIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ) ( pxList )->xListIntegrityValue1 = pdINTEGRITY_CHECK_VALUE
|
||||||
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
#define listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ) ( pxList )->xListIntegrityValue2 = pdINTEGRITY_CHECK_VALUE
|
||||||
|
|
||||||
/* Define macros that will assert if one of the structure members does not
|
/* Define macros that will assert if one of the structure members does not
|
||||||
* contain its expected value. */
|
* contain its expected value. */
|
||||||
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
#define listTEST_LIST_ITEM_INTEGRITY( pxItem ) configASSERT( ( ( pxItem )->xListItemIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxItem )->xListItemIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
||||||
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
#define listTEST_LIST_INTEGRITY( pxList ) configASSERT( ( ( pxList )->xListIntegrityValue1 == pdINTEGRITY_CHECK_VALUE ) && ( ( pxList )->xListIntegrityValue2 == pdINTEGRITY_CHECK_VALUE ) )
|
||||||
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
|
#endif /* configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition of the only type of object that a list can contain.
|
* Definition of the only type of object that a list can contain.
|
||||||
*/
|
*/
|
||||||
struct xLIST;
|
struct xLIST;
|
||||||
struct xLIST_ITEM
|
struct xLIST_ITEM
|
||||||
{
|
{
|
||||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
|
configLIST_VOLATILE TickType_t xItemValue; /*< The value being listed. In most cases this is used to sort the list in descending order. */
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
|
struct xLIST_ITEM * configLIST_VOLATILE pxNext; /*< Pointer to the next ListItem_t in the list. */
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
|
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious; /*< Pointer to the previous ListItem_t in the list. */
|
||||||
void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
|
void * pvOwner; /*< Pointer to the object (normally a TCB) that contains the list item. There is therefore a two way link between the object containing the list item and the list item itself. */
|
||||||
struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
|
struct xLIST * configLIST_VOLATILE pxContainer; /*< Pointer to the list in which this list item is placed (if any). */
|
||||||
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
listSECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
};
|
};
|
||||||
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
|
typedef struct xLIST_ITEM ListItem_t; /* For some reason lint wants this as two separate definitions. */
|
||||||
|
|
||||||
struct xMINI_LIST_ITEM
|
struct xMINI_LIST_ITEM
|
||||||
{
|
{
|
||||||
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
listFIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
configLIST_VOLATILE TickType_t xItemValue;
|
configLIST_VOLATILE TickType_t xItemValue;
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
|
struct xLIST_ITEM * configLIST_VOLATILE pxNext;
|
||||||
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
|
struct xLIST_ITEM * configLIST_VOLATILE pxPrevious;
|
||||||
};
|
};
|
||||||
typedef struct xMINI_LIST_ITEM MiniListItem_t;
|
typedef struct xMINI_LIST_ITEM MiniListItem_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definition of the type of queue used by the scheduler.
|
* Definition of the type of queue used by the scheduler.
|
||||||
*/
|
*/
|
||||||
typedef struct xLIST
|
typedef struct xLIST
|
||||||
{
|
{
|
||||||
listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
listFIRST_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
volatile UBaseType_t uxNumberOfItems;
|
volatile UBaseType_t uxNumberOfItems;
|
||||||
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
ListItem_t * configLIST_VOLATILE pxIndex; /*< Used to walk through the list. Points to the last item returned by a call to listGET_OWNER_OF_NEXT_ENTRY (). */
|
||||||
MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
|
MiniListItem_t xListEnd; /*< List item that contains the maximum possible item value meaning it is always at the end of the list and is therefore used as a marker. */
|
||||||
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
listSECOND_LIST_INTEGRITY_CHECK_VALUE /*< Set to a known value if configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
|
||||||
} List_t;
|
} List_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to set the owner of a list item. The owner of a list item
|
* Access macro to set the owner of a list item. The owner of a list item
|
||||||
|
@ -176,7 +179,7 @@
|
||||||
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
* \page listSET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
|
#define listSET_LIST_ITEM_OWNER( pxListItem, pxOwner ) ( ( pxListItem )->pvOwner = ( void * ) ( pxOwner ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to get the owner of a list item. The owner of a list item
|
* Access macro to get the owner of a list item. The owner of a list item
|
||||||
|
@ -185,7 +188,7 @@
|
||||||
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
* \page listGET_LIST_ITEM_OWNER listSET_LIST_ITEM_OWNER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
|
#define listGET_LIST_ITEM_OWNER( pxListItem ) ( ( pxListItem )->pvOwner )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to set the value of the list item. In most cases the value is
|
* Access macro to set the value of the list item. In most cases the value is
|
||||||
|
@ -194,7 +197,7 @@
|
||||||
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
* \page listSET_LIST_ITEM_VALUE listSET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
|
#define listSET_LIST_ITEM_VALUE( pxListItem, xValue ) ( ( pxListItem )->xItemValue = ( xValue ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to retrieve the value of the list item. The value can
|
* Access macro to retrieve the value of the list item. The value can
|
||||||
|
@ -204,7 +207,7 @@
|
||||||
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
|
#define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to retrieve the value of the list item at the head of a given
|
* Access macro to retrieve the value of the list item at the head of a given
|
||||||
|
@ -213,7 +216,7 @@
|
||||||
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
* \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
|
#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext->xItemValue )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list item at the head of the list.
|
* Return the list item at the head of the list.
|
||||||
|
@ -221,7 +224,7 @@
|
||||||
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
|
* \page listGET_HEAD_ENTRY listGET_HEAD_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
|
#define listGET_HEAD_ENTRY( pxList ) ( ( ( pxList )->xListEnd ).pxNext )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the next list item.
|
* Return the next list item.
|
||||||
|
@ -229,7 +232,7 @@
|
||||||
* \page listGET_NEXT listGET_NEXT
|
* \page listGET_NEXT listGET_NEXT
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
|
#define listGET_NEXT( pxListItem ) ( ( pxListItem )->pxNext )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list item that marks the end of the list
|
* Return the list item that marks the end of the list
|
||||||
|
@ -237,7 +240,7 @@
|
||||||
* \page listGET_END_MARKER listGET_END_MARKER
|
* \page listGET_END_MARKER listGET_END_MARKER
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
|
#define listGET_END_MARKER( pxList ) ( ( ListItem_t const * ) ( &( ( pxList )->xListEnd ) ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to determine if a list contains any items. The macro will
|
* Access macro to determine if a list contains any items. The macro will
|
||||||
|
@ -246,12 +249,12 @@
|
||||||
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY
|
* \page listLIST_IS_EMPTY listLIST_IS_EMPTY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
|
#define listLIST_IS_EMPTY( pxList ) ( ( ( pxList )->uxNumberOfItems == ( UBaseType_t ) 0 ) ? pdTRUE : pdFALSE )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access macro to return the number of items in the list.
|
* Access macro to return the number of items in the list.
|
||||||
*/
|
*/
|
||||||
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
|
#define listCURRENT_LIST_LENGTH( pxList ) ( ( pxList )->uxNumberOfItems )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Access function to obtain the owner of the next entry in a list.
|
* Access function to obtain the owner of the next entry in a list.
|
||||||
|
@ -273,7 +276,7 @@
|
||||||
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
* \page listGET_OWNER_OF_NEXT_ENTRY listGET_OWNER_OF_NEXT_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
#define listGET_OWNER_OF_NEXT_ENTRY( pxTCB, pxList ) \
|
||||||
{ \
|
{ \
|
||||||
List_t * const pxConstList = ( pxList ); \
|
List_t * const pxConstList = ( pxList ); \
|
||||||
/* Increment the index to the next item and return the item, ensuring */ \
|
/* Increment the index to the next item and return the item, ensuring */ \
|
||||||
|
@ -303,7 +306,7 @@
|
||||||
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
|
* \page listGET_OWNER_OF_HEAD_ENTRY listGET_OWNER_OF_HEAD_ENTRY
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
|
#define listGET_OWNER_OF_HEAD_ENTRY( pxList ) ( ( &( ( pxList )->xListEnd ) )->pxNext->pvOwner )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check to see if a list item is within a list. The list item maintains a
|
* Check to see if a list item is within a list. The list item maintains a
|
||||||
|
@ -314,7 +317,7 @@
|
||||||
* @param pxListItem The list item we want to know if is in the list.
|
* @param pxListItem The list item we want to know if is in the list.
|
||||||
* @return pdTRUE if the list item is in the list, otherwise pdFALSE.
|
* @return pdTRUE if the list item is in the list, otherwise pdFALSE.
|
||||||
*/
|
*/
|
||||||
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
|
#define listIS_CONTAINED_WITHIN( pxList, pxListItem ) ( ( ( pxListItem )->pxContainer == ( pxList ) ) ? ( pdTRUE ) : ( pdFALSE ) )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return the list a list item is contained within (referenced from).
|
* Return the list a list item is contained within (referenced from).
|
||||||
|
@ -322,14 +325,14 @@
|
||||||
* @param pxListItem The list item being queried.
|
* @param pxListItem The list item being queried.
|
||||||
* @return A pointer to the List_t object that references the pxListItem
|
* @return A pointer to the List_t object that references the pxListItem
|
||||||
*/
|
*/
|
||||||
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
|
#define listLIST_ITEM_CONTAINER( pxListItem ) ( ( pxListItem )->pxContainer )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This provides a crude means of knowing if a list has been initialised, as
|
* This provides a crude means of knowing if a list has been initialised, as
|
||||||
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
|
* pxList->xListEnd.xItemValue is set to portMAX_DELAY by the vListInitialise()
|
||||||
* function.
|
* function.
|
||||||
*/
|
*/
|
||||||
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
|
#define listLIST_IS_INITIALISED( pxList ) ( ( pxList )->xListEnd.xItemValue == portMAX_DELAY )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Must be called before a list is used! This initialises all the members
|
* Must be called before a list is used! This initialises all the members
|
||||||
|
@ -341,7 +344,7 @@
|
||||||
* \page vListInitialise vListInitialise
|
* \page vListInitialise vListInitialise
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
|
void vListInitialise( List_t * const pxList ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Must be called before a list item is used. This sets the list container to
|
* Must be called before a list item is used. This sets the list container to
|
||||||
|
@ -352,7 +355,7 @@
|
||||||
* \page vListInitialiseItem vListInitialiseItem
|
* \page vListInitialiseItem vListInitialiseItem
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
|
void vListInitialiseItem( ListItem_t * const pxItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert a list item into a list. The item will be inserted into the list in
|
* Insert a list item into a list. The item will be inserted into the list in
|
||||||
|
@ -365,8 +368,8 @@
|
||||||
* \page vListInsert vListInsert
|
* \page vListInsert vListInsert
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInsert( List_t * const pxList,
|
void vListInsert( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insert a list item into a list. The item will be inserted in a position
|
* Insert a list item into a list. The item will be inserted in a position
|
||||||
|
@ -387,8 +390,8 @@
|
||||||
* \page vListInsertEnd vListInsertEnd
|
* \page vListInsertEnd vListInsertEnd
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
void vListInsertEnd( List_t * const pxList,
|
void vListInsertEnd( List_t * const pxList,
|
||||||
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
ListItem_t * const pxNewListItem ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Remove an item from a list. The list item has a pointer to the list that
|
* Remove an item from a list. The list item has a pointer to the list that
|
||||||
|
@ -403,10 +406,12 @@
|
||||||
* \page uxListRemove uxListRemove
|
* \page uxListRemove uxListRemove
|
||||||
* \ingroup LinkedList
|
* \ingroup LinkedList
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* ifndef LIST_H */
|
#endif /* ifndef LIST_H */
|
||||||
|
|
|
@ -59,18 +59,20 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef FREERTOS_MESSAGE_BUFFER_H
|
#ifndef FREERTOS_MESSAGE_BUFFER_H
|
||||||
#define FREERTOS_MESSAGE_BUFFER_H
|
#define FREERTOS_MESSAGE_BUFFER_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h must appear in source files before include message_buffer.h"
|
#error "include FreeRTOS.h must appear in source files before include message_buffer.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Message buffers are built onto of stream buffers. */
|
/* Message buffers are built onto of stream buffers. */
|
||||||
#include "stream_buffer.h"
|
#include "stream_buffer.h"
|
||||||
|
|
||||||
#if defined( __cplusplus )
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#if defined( __cplusplus )
|
||||||
#endif
|
extern "C" {
|
||||||
|
#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
|
||||||
|
@ -78,7 +80,7 @@
|
||||||
* then be used as a parameter to xMessageBufferSend(), xMessageBufferReceive(),
|
* then be used as a parameter to xMessageBufferSend(), xMessageBufferReceive(),
|
||||||
* etc.
|
* etc.
|
||||||
*/
|
*/
|
||||||
typedef void * MessageBufferHandle_t;
|
typedef void * MessageBufferHandle_t;
|
||||||
|
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -138,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
|
||||||
|
@ -204,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
|
||||||
|
@ -303,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
|
||||||
|
@ -407,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
|
||||||
|
@ -495,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 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -596,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
|
||||||
|
@ -616,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
|
||||||
|
@ -633,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
|
||||||
|
@ -649,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
|
||||||
|
@ -672,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 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -694,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
|
||||||
|
@ -714,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
|
||||||
|
@ -753,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
|
||||||
|
@ -793,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 )
|
||||||
|
|
||||||
#if defined( __cplusplus )
|
/* *INDENT-OFF* */
|
||||||
} /* extern "C" */
|
#if defined( __cplusplus )
|
||||||
#endif
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* !defined( FREERTOS_MESSAGE_BUFFER_H ) */
|
#endif /* !defined( FREERTOS_MESSAGE_BUFFER_H ) */
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef PORTABLE_H
|
#ifndef PORTABLE_H
|
||||||
#define PORTABLE_H
|
#define PORTABLE_H
|
||||||
|
|
||||||
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
/* Each FreeRTOS port has a unique portmacro.h header file. Originally a
|
||||||
* pre-processor definition was used to ensure the pre-processor found the correct
|
* pre-processor definition was used to ensure the pre-processor found the correct
|
||||||
|
@ -41,61 +41,63 @@
|
||||||
* to make it clear that new projects should not use it, support for the port
|
* to make it clear that new projects should not use it, support for the port
|
||||||
* specific constants has been moved into the deprecated_definitions.h header
|
* specific constants has been moved into the deprecated_definitions.h header
|
||||||
* file. */
|
* file. */
|
||||||
#include "deprecated_definitions.h"
|
#include "deprecated_definitions.h"
|
||||||
|
|
||||||
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
/* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
|
||||||
* did not result in a portmacro.h header file being included - and it should be
|
* did not result in a portmacro.h header file being included - and it should be
|
||||||
* included here. In this case the path to the correct portmacro.h header file
|
* included here. In this case the path to the correct portmacro.h header file
|
||||||
* must be set in the compiler's include path. */
|
* must be set in the compiler's include path. */
|
||||||
#ifndef portENTER_CRITICAL
|
#ifndef portENTER_CRITICAL
|
||||||
#include "portmacro.h"
|
#include "portmacro.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 32
|
#if portBYTE_ALIGNMENT == 32
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x001f )
|
#define portBYTE_ALIGNMENT_MASK ( 0x001f )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 16
|
#if portBYTE_ALIGNMENT == 16
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x000f )
|
#define portBYTE_ALIGNMENT_MASK ( 0x000f )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 8
|
#if portBYTE_ALIGNMENT == 8
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0007 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 4
|
#if portBYTE_ALIGNMENT == 4
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0003 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0003 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 2
|
#if portBYTE_ALIGNMENT == 2
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0001 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if portBYTE_ALIGNMENT == 1
|
#if portBYTE_ALIGNMENT == 1
|
||||||
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
#define portBYTE_ALIGNMENT_MASK ( 0x0000 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portBYTE_ALIGNMENT_MASK
|
#ifndef portBYTE_ALIGNMENT_MASK
|
||||||
#error "Invalid portBYTE_ALIGNMENT definition"
|
#error "Invalid portBYTE_ALIGNMENT definition"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portNUM_CONFIGURABLE_REGIONS
|
#ifndef portNUM_CONFIGURABLE_REGIONS
|
||||||
#define portNUM_CONFIGURABLE_REGIONS 1
|
#define portNUM_CONFIGURABLE_REGIONS 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portHAS_STACK_OVERFLOW_CHECKING
|
#ifndef portHAS_STACK_OVERFLOW_CHECKING
|
||||||
#define portHAS_STACK_OVERFLOW_CHECKING 0
|
#define portHAS_STACK_OVERFLOW_CHECKING 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef portARCH_NAME
|
#ifndef portARCH_NAME
|
||||||
#define portARCH_NAME NULL
|
#define portARCH_NAME NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#include "mpu_wrappers.h"
|
#include "mpu_wrappers.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the stack of a new task so it is ready to be placed under the
|
* Setup the stack of a new task so it is ready to be placed under the
|
||||||
|
@ -103,51 +105,51 @@
|
||||||
* the order that the port expects to find them.
|
* the order that the port expects to find them.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
StackType_t * pxEndOfStack,
|
StackType_t * pxEndOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters,
|
void * pvParameters,
|
||||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters,
|
void * pvParameters,
|
||||||
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
#else /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||||
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
#if ( portHAS_STACK_OVERFLOW_CHECKING == 1 )
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
StackType_t * pxEndOfStack,
|
StackType_t * pxEndOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||||
#else
|
#else
|
||||||
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
StackType_t * pxPortInitialiseStack( StackType_t * pxTopOfStack,
|
||||||
TaskFunction_t pxCode,
|
TaskFunction_t pxCode,
|
||||||
void * pvParameters ) PRIVILEGED_FUNCTION;
|
void * pvParameters ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
#endif /* if ( portUSING_MPU_WRAPPERS == 1 ) */
|
||||||
|
|
||||||
/* Used by heap_5.c to define the start address and size of each memory region
|
/* Used by heap_5.c to define the start address and size of each memory region
|
||||||
* that together comprise the total FreeRTOS heap space. */
|
* that together comprise the total FreeRTOS heap space. */
|
||||||
typedef struct HeapRegion
|
typedef struct HeapRegion
|
||||||
{
|
{
|
||||||
uint8_t * pucStartAddress;
|
uint8_t * pucStartAddress;
|
||||||
size_t xSizeInBytes;
|
size_t xSizeInBytes;
|
||||||
} HeapRegion_t;
|
} HeapRegion_t;
|
||||||
|
|
||||||
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
/* Used to pass information about the heap out of vPortGetHeapStats(). */
|
||||||
typedef struct xHeapStats
|
typedef struct xHeapStats
|
||||||
{
|
{
|
||||||
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
size_t xAvailableHeapSpaceInBytes; /* The total heap size currently available - this is the sum of all the free blocks, not the largest block that can be allocated. */
|
||||||
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xSizeOfLargestFreeBlockInBytes; /* The maximum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xSizeOfSmallestFreeBlockInBytes; /* The minimum size, in bytes, of all the free blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
size_t xNumberOfFreeBlocks; /* The number of free memory blocks within the heap at the time vPortGetHeapStats() is called. */
|
||||||
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
size_t xMinimumEverFreeBytesRemaining; /* The minimum amount of total free memory (sum of all free blocks) there has been in the heap since the system booted. */
|
||||||
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
size_t xNumberOfSuccessfulAllocations; /* The number of calls to pvPortMalloc() that have returned a valid memory block. */
|
||||||
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
size_t xNumberOfSuccessfulFrees; /* The number of calls to vPortFree() that has successfully freed a block of memory. */
|
||||||
} HeapStats_t;
|
} HeapStats_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used to define multiple heap regions for use by heap_5.c. This function
|
* Used to define multiple heap regions for use by heap_5.c. This function
|
||||||
|
@ -160,35 +162,35 @@
|
||||||
* terminated by a HeapRegions_t structure that has a size of 0. The region
|
* terminated by a HeapRegions_t structure that has a size of 0. The region
|
||||||
* with the lowest start address must appear first in the array.
|
* with the lowest start address must appear first in the array.
|
||||||
*/
|
*/
|
||||||
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
|
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns a HeapStats_t structure filled with information about the current
|
* Returns a HeapStats_t structure filled with information about the current
|
||||||
* heap state.
|
* heap state.
|
||||||
*/
|
*/
|
||||||
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
|
void vPortGetHeapStats( HeapStats_t * pxHeapStats );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map to the memory management routines required for the port.
|
* Map to the memory management routines required for the port.
|
||||||
*/
|
*/
|
||||||
void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
void * pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
|
||||||
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
|
void vPortFree( void * pv ) PRIVILEGED_FUNCTION;
|
||||||
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
|
||||||
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||||
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup the hardware ready for the scheduler to take control. This generally
|
* Setup the hardware ready for the scheduler to take control. This generally
|
||||||
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
* sets up a tick interrupt and sets timers for the correct tick frequency.
|
||||||
*/
|
*/
|
||||||
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
|
BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
|
* Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
|
||||||
* the hardware is left in its original condition after the scheduler stops
|
* the hardware is left in its original condition after the scheduler stops
|
||||||
* executing.
|
* executing.
|
||||||
*/
|
*/
|
||||||
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
|
void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The structures and methods of manipulating the MPU are contained within the
|
* The structures and methods of manipulating the MPU are contained within the
|
||||||
|
@ -197,16 +199,18 @@
|
||||||
* Fills the xMPUSettings structure with the memory region information
|
* Fills the xMPUSettings structure with the memory region information
|
||||||
* contained in xRegions.
|
* contained in xRegions.
|
||||||
*/
|
*/
|
||||||
#if ( portUSING_MPU_WRAPPERS == 1 )
|
#if ( portUSING_MPU_WRAPPERS == 1 )
|
||||||
struct xMEMORY_REGION;
|
struct xMEMORY_REGION;
|
||||||
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
void vPortStoreTaskMPUSettings( xMPU_SETTINGS * xMPUSettings,
|
||||||
const struct xMEMORY_REGION * const xRegions,
|
const struct xMEMORY_REGION * const xRegions,
|
||||||
StackType_t * pxBottomOfStack,
|
StackType_t * pxBottomOfStack,
|
||||||
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* PORTABLE_H */
|
#endif /* PORTABLE_H */
|
||||||
|
|
292
include/queue.h
292
include/queue.h
|
@ -26,52 +26,54 @@
|
||||||
|
|
||||||
|
|
||||||
#ifndef QUEUE_H
|
#ifndef QUEUE_H
|
||||||
#define QUEUE_H
|
#define QUEUE_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#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
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type by which queues are referenced. For example, a call to xQueueCreate()
|
* Type by which queues are referenced. For example, a call to xQueueCreate()
|
||||||
* returns an QueueHandle_t variable that can then be used as a parameter to
|
* returns an QueueHandle_t variable that can then be used as a parameter to
|
||||||
* xQueueSend(), xQueueReceive(), etc.
|
* xQueueSend(), xQueueReceive(), etc.
|
||||||
*/
|
*/
|
||||||
struct QueueDefinition; /* Using old naming convention so as not to break kernel aware debuggers. */
|
struct QueueDefinition; /* Using old naming convention so as not to break kernel aware debuggers. */
|
||||||
typedef struct QueueDefinition * QueueHandle_t;
|
typedef struct QueueDefinition * QueueHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type by which queue sets are referenced. For example, a call to
|
* Type by which queue sets are referenced. For example, a call to
|
||||||
* xQueueCreateSet() returns an xQueueSet variable that can then be used as a
|
* xQueueCreateSet() returns an xQueueSet variable that can then be used as a
|
||||||
* parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
|
* parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
|
||||||
*/
|
*/
|
||||||
typedef struct QueueDefinition * QueueSetHandle_t;
|
typedef struct QueueDefinition * QueueSetHandle_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Queue sets can contain both queues and semaphores, so the
|
* Queue sets can contain both queues and semaphores, so the
|
||||||
* QueueSetMemberHandle_t is defined as a type to be used where a parameter or
|
* QueueSetMemberHandle_t is defined as a type to be used where a parameter or
|
||||||
* return value can be either an QueueHandle_t or an SemaphoreHandle_t.
|
* return value can be either an QueueHandle_t or an SemaphoreHandle_t.
|
||||||
*/
|
*/
|
||||||
typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
typedef struct QueueDefinition * QueueSetMemberHandle_t;
|
||||||
|
|
||||||
/* For internal use only. */
|
/* For internal use only. */
|
||||||
#define queueSEND_TO_BACK ( ( BaseType_t ) 0 )
|
#define queueSEND_TO_BACK ( ( BaseType_t ) 0 )
|
||||||
#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 )
|
#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 )
|
||||||
#define queueOVERWRITE ( ( BaseType_t ) 2 )
|
#define queueOVERWRITE ( ( BaseType_t ) 2 )
|
||||||
|
|
||||||
/* For internal use only. These definitions *must* match those in queue.c. */
|
/* For internal use only. These definitions *must* match those in queue.c. */
|
||||||
#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U )
|
#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U )
|
||||||
#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U )
|
#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U )
|
||||||
#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U )
|
#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U )
|
||||||
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U )
|
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U )
|
||||||
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U )
|
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U )
|
||||||
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U )
|
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -141,9 +143,9 @@
|
||||||
* \defgroup xQueueCreate xQueueCreate
|
* \defgroup xQueueCreate xQueueCreate
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||||
#define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )
|
#define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -227,9 +229,9 @@
|
||||||
* \defgroup xQueueCreateStatic xQueueCreateStatic
|
* \defgroup xQueueCreateStatic xQueueCreateStatic
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
#define xQueueCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer ) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) )
|
#define xQueueCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer ) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) )
|
||||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -309,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
|
||||||
|
@ -391,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
|
||||||
|
@ -475,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
|
||||||
|
@ -558,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 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -646,10 +652,10 @@
|
||||||
* \defgroup xQueueSend xQueueSend
|
* \defgroup xQueueSend xQueueSend
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||||
const void * const pvItemToQueue,
|
const void * const pvItemToQueue,
|
||||||
TickType_t xTicksToWait,
|
TickType_t xTicksToWait,
|
||||||
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -680,7 +686,7 @@
|
||||||
*
|
*
|
||||||
* @param xTicksToWait The maximum amount of time the task should block
|
* @param xTicksToWait The maximum amount of time the task should block
|
||||||
* waiting for an item to receive should the queue be empty at the time
|
* waiting for an item to receive should the queue be empty at the time
|
||||||
* of the call. The time is defined in tick periods so the constant
|
* of the call. The time is defined in tick periods so the constant
|
||||||
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
|
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
|
||||||
* xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
|
* xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
|
||||||
* is empty.
|
* is empty.
|
||||||
|
@ -743,9 +749,9 @@
|
||||||
* \defgroup xQueuePeek xQueuePeek
|
* \defgroup xQueuePeek xQueuePeek
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueuePeek( QueueHandle_t xQueue,
|
BaseType_t xQueuePeek( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer,
|
void * const pvBuffer,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -778,8 +784,8 @@
|
||||||
* \defgroup xQueuePeekFromISR xQueuePeekFromISR
|
* \defgroup xQueuePeekFromISR xQueuePeekFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
void * const pvBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -807,7 +813,7 @@
|
||||||
*
|
*
|
||||||
* @param xTicksToWait The maximum amount of time the task should block
|
* @param xTicksToWait The maximum amount of time the task should block
|
||||||
* waiting for an item to receive should the queue be empty at the time
|
* waiting for an item to receive should the queue be empty at the time
|
||||||
* of the call. xQueueReceive() will return immediately if xTicksToWait
|
* of the call. xQueueReceive() will return immediately if xTicksToWait
|
||||||
* is zero and the queue is empty. The time is defined in tick periods so the
|
* is zero and the queue is empty. The time is defined in tick periods so the
|
||||||
* constant portTICK_PERIOD_MS should be used to convert to real time if this is
|
* constant portTICK_PERIOD_MS should be used to convert to real time if this is
|
||||||
* required.
|
* required.
|
||||||
|
@ -870,9 +876,9 @@
|
||||||
* \defgroup xQueueReceive xQueueReceive
|
* \defgroup xQueueReceive xQueueReceive
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueReceive( QueueHandle_t xQueue,
|
BaseType_t xQueueReceive( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer,
|
void * const pvBuffer,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -887,7 +893,7 @@
|
||||||
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
|
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -904,7 +910,7 @@
|
||||||
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
|
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -918,7 +924,7 @@
|
||||||
* \defgroup vQueueDelete vQueueDelete
|
* \defgroup vQueueDelete vQueueDelete
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
|
@ -988,7 +994,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 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1059,7 +1066,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
|
||||||
|
@ -1146,7 +1154,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
|
||||||
|
@ -1220,16 +1229,17 @@
|
||||||
* \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
|
||||||
* <pre>
|
* <pre>
|
||||||
* BaseType_t xQueueGenericSendFromISR(
|
* BaseType_t xQueueGenericSendFromISR(
|
||||||
* QueueHandle_t xQueue,
|
* QueueHandle_t xQueue,
|
||||||
* const void *pvItemToQueue,
|
* const void *pvItemToQueue,
|
||||||
* BaseType_t *pxHigherPriorityTaskWoken,
|
* BaseType_t *pxHigherPriorityTaskWoken,
|
||||||
* BaseType_t xCopyPosition
|
* BaseType_t xCopyPosition
|
||||||
* );
|
* );
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1299,20 +1309,20 @@
|
||||||
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
* \defgroup xQueueSendFromISR xQueueSendFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
||||||
const void * const pvItemToQueue,
|
const void * const pvItemToQueue,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||||
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* queue. h
|
* queue. h
|
||||||
* <pre>
|
* <pre>
|
||||||
* BaseType_t xQueueReceiveFromISR(
|
* BaseType_t xQueueReceiveFromISR(
|
||||||
* QueueHandle_t xQueue,
|
* QueueHandle_t xQueue,
|
||||||
* void *pvBuffer,
|
* void *pvBuffer,
|
||||||
* BaseType_t *pxTaskWoken
|
* BaseType_t *pxTaskWoken
|
||||||
* );
|
* );
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -1393,17 +1403,17 @@
|
||||||
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
|
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
|
||||||
* \ingroup QueueManagement
|
* \ingroup QueueManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
|
||||||
void * const pvBuffer,
|
void * const pvBuffer,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Utilities to query queues that are safe to use from an ISR. These utilities
|
* Utilities to query queues that are safe to use from an ISR. These utilities
|
||||||
* should be used only from witin an ISR, or within a critical section.
|
* should be used only from witin an ISR, or within a critical section.
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The functions defined above are for passing data to and from tasks. The
|
* The functions defined above are for passing data to and from tasks. The
|
||||||
|
@ -1414,50 +1424,50 @@
|
||||||
* should not be called directly from application code. Instead use the macro
|
* should not be called directly from application code. Instead use the macro
|
||||||
* wrappers defined within croutine.h.
|
* wrappers defined within croutine.h.
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueueCRSendFromISR( QueueHandle_t xQueue,
|
||||||
const void * pvItemToQueue,
|
const void * pvItemToQueue,
|
||||||
BaseType_t xCoRoutinePreviouslyWoken );
|
BaseType_t xCoRoutinePreviouslyWoken );
|
||||||
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
|
BaseType_t xQueueCRReceiveFromISR( QueueHandle_t xQueue,
|
||||||
void * pvBuffer,
|
void * pvBuffer,
|
||||||
BaseType_t * pxTaskWoken );
|
BaseType_t * pxTaskWoken );
|
||||||
BaseType_t xQueueCRSend( QueueHandle_t xQueue,
|
BaseType_t xQueueCRSend( QueueHandle_t xQueue,
|
||||||
const void * pvItemToQueue,
|
const void * pvItemToQueue,
|
||||||
TickType_t xTicksToWait );
|
TickType_t xTicksToWait );
|
||||||
BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
|
BaseType_t xQueueCRReceive( QueueHandle_t xQueue,
|
||||||
void * pvBuffer,
|
void * pvBuffer,
|
||||||
TickType_t xTicksToWait );
|
TickType_t xTicksToWait );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For internal use only. Use xSemaphoreCreateMutex(),
|
* For internal use only. Use xSemaphoreCreateMutex(),
|
||||||
* xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
|
* xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
|
||||||
* these functions directly.
|
* these functions directly.
|
||||||
*/
|
*/
|
||||||
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||||
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
|
||||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||||
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
|
||||||
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
|
||||||
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
|
||||||
const UBaseType_t uxInitialCount,
|
const UBaseType_t uxInitialCount,
|
||||||
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||||
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
|
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
|
||||||
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
|
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset a queue back to its original empty state. The return value is now
|
* Reset a queue back to its original empty state. The return value is now
|
||||||
* obsolete and is always set to pdPASS.
|
* obsolete and is always set to pdPASS.
|
||||||
*/
|
*/
|
||||||
#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
|
#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The registry is provided as a means for kernel aware debuggers to
|
* The registry is provided as a means for kernel aware debuggers to
|
||||||
|
@ -1481,10 +1491,10 @@
|
||||||
* stores a pointer to the string - so the string must be persistent (global or
|
* stores a pointer to the string - so the string must be persistent (global or
|
||||||
* preferably in ROM/Flash), not on the stack.
|
* preferably in ROM/Flash), not on the stack.
|
||||||
*/
|
*/
|
||||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||||
void vQueueAddToRegistry( QueueHandle_t xQueue,
|
void vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||||
const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
const char * pcQueueName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The registry is provided as a means for kernel aware debuggers to
|
* The registry is provided as a means for kernel aware debuggers to
|
||||||
|
@ -1496,9 +1506,9 @@
|
||||||
*
|
*
|
||||||
* @param xQueue The handle of the queue being removed from the registry.
|
* @param xQueue The handle of the queue being removed from the registry.
|
||||||
*/
|
*/
|
||||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||||
void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The queue registry is provided as a means for kernel aware debuggers to
|
* The queue registry is provided as a means for kernel aware debuggers to
|
||||||
|
@ -1511,33 +1521,33 @@
|
||||||
* queue is returned. If the queue is not in the registry then NULL is
|
* queue is returned. If the queue is not in the registry then NULL is
|
||||||
* returned.
|
* returned.
|
||||||
*/
|
*/
|
||||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||||
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generic version of the function used to creaet a queue using dynamic memory
|
* Generic version of the function used to creaet a queue using dynamic memory
|
||||||
* allocation. This is called by other functions and macros that create other
|
* allocation. This is called by other functions and macros that create other
|
||||||
* RTOS objects that use the queue structure as their base.
|
* RTOS objects that use the queue structure as their base.
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||||
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
|
||||||
const UBaseType_t uxItemSize,
|
const UBaseType_t uxItemSize,
|
||||||
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generic version of the function used to creaet a queue using dynamic memory
|
* Generic version of the function used to creaet a queue using dynamic memory
|
||||||
* allocation. This is called by other functions and macros that create other
|
* allocation. This is called by other functions and macros that create other
|
||||||
* RTOS objects that use the queue structure as their base.
|
* RTOS objects that use the queue structure as their base.
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
|
||||||
const UBaseType_t uxItemSize,
|
const UBaseType_t uxItemSize,
|
||||||
uint8_t * pucQueueStorage,
|
uint8_t * pucQueueStorage,
|
||||||
StaticQueue_t * pxStaticQueue,
|
StaticQueue_t * pxStaticQueue,
|
||||||
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Queue sets provide a mechanism to allow a task to block (pend) on a read
|
* Queue sets provide a mechanism to allow a task to block (pend) on a read
|
||||||
|
@ -1587,7 +1597,7 @@
|
||||||
* @return If the queue set is created successfully then a handle to the created
|
* @return If the queue set is created successfully then a handle to the created
|
||||||
* queue set is returned. Otherwise NULL is returned.
|
* queue set is returned. Otherwise NULL is returned.
|
||||||
*/
|
*/
|
||||||
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
|
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Adds a queue or semaphore to a queue set that was previously created by a
|
* Adds a queue or semaphore to a queue set that was previously created by a
|
||||||
|
@ -1611,8 +1621,8 @@
|
||||||
* queue set because it is already a member of a different queue set then pdFAIL
|
* queue set because it is already a member of a different queue set then pdFAIL
|
||||||
* is returned.
|
* is returned.
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||||
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
|
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
|
||||||
|
@ -1631,8 +1641,8 @@
|
||||||
* then pdPASS is returned. If the queue was not in the queue set, or the
|
* then pdPASS is returned. If the queue was not in the queue set, or the
|
||||||
* queue (or semaphore) was not empty, then pdFAIL is returned.
|
* queue (or semaphore) was not empty, then pdFAIL is returned.
|
||||||
*/
|
*/
|
||||||
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||||
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xQueueSelectFromSet() selects from the members of a queue set a queue or
|
* xQueueSelectFromSet() selects from the members of a queue set a queue or
|
||||||
|
@ -1668,28 +1678,30 @@
|
||||||
* in the queue set that is available, or NULL if no such queue or semaphore
|
* in the queue set that is available, or NULL if no such queue or semaphore
|
||||||
* exists before before the specified block time expires.
|
* exists before before the specified block time expires.
|
||||||
*/
|
*/
|
||||||
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A version of xQueueSelectFromSet() that can be used from an ISR.
|
* A version of xQueueSelectFromSet() that can be used from an ISR.
|
||||||
*/
|
*/
|
||||||
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/* Not public API functions. */
|
/* Not public API functions. */
|
||||||
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
|
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
|
||||||
TickType_t xTicksToWait,
|
TickType_t xTicksToWait,
|
||||||
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
|
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
|
||||||
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
|
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
|
||||||
void vQueueSetQueueNumber( QueueHandle_t xQueue,
|
void vQueueSetQueueNumber( QueueHandle_t xQueue,
|
||||||
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
|
||||||
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* QUEUE_H */
|
#endif /* QUEUE_H */
|
||||||
|
|
|
@ -48,15 +48,17 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STREAM_BUFFER_H
|
#ifndef STREAM_BUFFER_H
|
||||||
#define STREAM_BUFFER_H
|
#define STREAM_BUFFER_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#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
|
||||||
|
|
||||||
#if defined( __cplusplus )
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#if defined( __cplusplus )
|
||||||
#endif
|
extern "C" {
|
||||||
|
#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
|
||||||
|
@ -64,8 +66,8 @@
|
||||||
* then be used as a parameter to xStreamBufferSend(), xStreamBufferReceive(),
|
* then be used as a parameter to xStreamBufferSend(), xStreamBufferReceive(),
|
||||||
* etc.
|
* etc.
|
||||||
*/
|
*/
|
||||||
struct StreamBufferDef_t;
|
struct StreamBufferDef_t;
|
||||||
typedef struct StreamBufferDef_t * StreamBufferHandle_t;
|
typedef struct StreamBufferDef_t * StreamBufferHandle_t;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,7 +135,7 @@
|
||||||
* \defgroup xStreamBufferCreate xStreamBufferCreate
|
* \defgroup xStreamBufferCreate xStreamBufferCreate
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE )
|
#define xStreamBufferCreate( xBufferSizeBytes, xTriggerLevelBytes ) xStreamBufferGenericCreate( xBufferSizeBytes, xTriggerLevelBytes, pdFALSE )
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -214,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
|
||||||
|
@ -308,10 +311,10 @@
|
||||||
* \defgroup xStreamBufferSend xStreamBufferSend
|
* \defgroup xStreamBufferSend xStreamBufferSend
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||||
const void * pvTxData,
|
const void * pvTxData,
|
||||||
size_t xDataLengthBytes,
|
size_t xDataLengthBytes,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -409,10 +412,10 @@
|
||||||
* \defgroup xStreamBufferSendFromISR xStreamBufferSendFromISR
|
* \defgroup xStreamBufferSendFromISR xStreamBufferSendFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
size_t xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||||
const void * pvTxData,
|
const void * pvTxData,
|
||||||
size_t xDataLengthBytes,
|
size_t xDataLengthBytes,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -498,10 +501,10 @@
|
||||||
* \defgroup xStreamBufferReceive xStreamBufferReceive
|
* \defgroup xStreamBufferReceive xStreamBufferReceive
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
size_t xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||||
void * pvRxData,
|
void * pvRxData,
|
||||||
size_t xBufferLengthBytes,
|
size_t xBufferLengthBytes,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -584,10 +587,10 @@
|
||||||
* \defgroup xStreamBufferReceiveFromISR xStreamBufferReceiveFromISR
|
* \defgroup xStreamBufferReceiveFromISR xStreamBufferReceiveFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
size_t xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||||
void * pvRxData,
|
void * pvRxData,
|
||||||
size_t xBufferLengthBytes,
|
size_t xBufferLengthBytes,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -609,7 +612,7 @@
|
||||||
* \defgroup vStreamBufferDelete vStreamBufferDelete
|
* \defgroup vStreamBufferDelete vStreamBufferDelete
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
void vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -629,7 +632,7 @@
|
||||||
* \defgroup xStreamBufferIsFull xStreamBufferIsFull
|
* \defgroup xStreamBufferIsFull xStreamBufferIsFull
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
BaseType_t xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -649,7 +652,7 @@
|
||||||
* \defgroup xStreamBufferIsEmpty xStreamBufferIsEmpty
|
* \defgroup xStreamBufferIsEmpty xStreamBufferIsEmpty
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
BaseType_t xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -672,7 +675,7 @@
|
||||||
* \defgroup xStreamBufferReset xStreamBufferReset
|
* \defgroup xStreamBufferReset xStreamBufferReset
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
BaseType_t xStreamBufferReset( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -693,7 +696,7 @@
|
||||||
* \defgroup xStreamBufferSpacesAvailable xStreamBufferSpacesAvailable
|
* \defgroup xStreamBufferSpacesAvailable xStreamBufferSpacesAvailable
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
size_t xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -714,7 +717,7 @@
|
||||||
* \defgroup xStreamBufferBytesAvailable xStreamBufferBytesAvailable
|
* \defgroup xStreamBufferBytesAvailable xStreamBufferBytesAvailable
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
size_t xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -751,8 +754,8 @@
|
||||||
* \defgroup xStreamBufferSetTriggerLevel xStreamBufferSetTriggerLevel
|
* \defgroup xStreamBufferSetTriggerLevel xStreamBufferSetTriggerLevel
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
BaseType_t xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||||
size_t xTriggerLevel ) PRIVILEGED_FUNCTION;
|
size_t xTriggerLevel ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -791,8 +794,8 @@
|
||||||
* \defgroup xStreamBufferSendCompletedFromISR xStreamBufferSendCompletedFromISR
|
* \defgroup xStreamBufferSendCompletedFromISR xStreamBufferSendCompletedFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
BaseType_t xStreamBufferSendCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* stream_buffer.h
|
* stream_buffer.h
|
||||||
|
@ -832,31 +835,33 @@
|
||||||
* \defgroup xStreamBufferReceiveCompletedFromISR xStreamBufferReceiveCompletedFromISR
|
* \defgroup xStreamBufferReceiveCompletedFromISR xStreamBufferReceiveCompletedFromISR
|
||||||
* \ingroup StreamBufferManagement
|
* \ingroup StreamBufferManagement
|
||||||
*/
|
*/
|
||||||
BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
BaseType_t xStreamBufferReceiveCompletedFromISR( StreamBufferHandle_t xStreamBuffer,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/* Functions below here are not part of the public API. */
|
/* Functions below here are not part of the public API. */
|
||||||
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
StreamBufferHandle_t xStreamBufferGenericCreate( size_t xBufferSizeBytes,
|
||||||
size_t xTriggerLevelBytes,
|
size_t xTriggerLevelBytes,
|
||||||
BaseType_t xIsMessageBuffer ) PRIVILEGED_FUNCTION;
|
BaseType_t xIsMessageBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
StreamBufferHandle_t xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes,
|
||||||
size_t xTriggerLevelBytes,
|
size_t xTriggerLevelBytes,
|
||||||
BaseType_t xIsMessageBuffer,
|
BaseType_t xIsMessageBuffer,
|
||||||
uint8_t * const pucStreamBufferStorageArea,
|
uint8_t * const pucStreamBufferStorageArea,
|
||||||
StaticStreamBuffer_t * const pxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
|
StaticStreamBuffer_t * const pxStaticStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
size_t xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
void vStreamBufferSetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer,
|
void vStreamBufferSetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer,
|
||||||
UBaseType_t uxStreamBufferNumber ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxStreamBufferNumber ) PRIVILEGED_FUNCTION;
|
||||||
UBaseType_t uxStreamBufferGetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxStreamBufferGetStreamBufferNumber( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
uint8_t ucStreamBufferGetStreamBufferType( StreamBufferHandle_t xStreamBuffer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( __cplusplus )
|
/* *INDENT-OFF* */
|
||||||
}
|
#if defined( __cplusplus )
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
#endif /* !defined( STREAM_BUFFER_H ) */
|
#endif /* !defined( STREAM_BUFFER_H ) */
|
||||||
|
|
554
include/task.h
554
include/task.h
File diff suppressed because it is too large
Load diff
187
include/timers.h
187
include/timers.h
|
@ -26,20 +26,22 @@
|
||||||
|
|
||||||
|
|
||||||
#ifndef TIMERS_H
|
#ifndef TIMERS_H
|
||||||
#define TIMERS_H
|
#define TIMERS_H
|
||||||
|
|
||||||
#ifndef INC_FREERTOS_H
|
#ifndef INC_FREERTOS_H
|
||||||
#error "include FreeRTOS.h must appear in source files before include timers.h"
|
#error "include FreeRTOS.h must appear in source files before include timers.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*lint -save -e537 This headers are only multiply included if the application code
|
/*lint -save -e537 This headers are only multiply included if the application code
|
||||||
* happens to also be including task.h. */
|
* happens to also be including task.h. */
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
/*lint -restore */
|
/*lint -restore */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
#endif
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
|
|
||||||
/*-----------------------------------------------------------
|
/*-----------------------------------------------------------
|
||||||
* MACROS AND DEFINITIONS
|
* MACROS AND DEFINITIONS
|
||||||
|
@ -50,20 +52,20 @@
|
||||||
* as defined below. The commands that are sent from interrupts must use the
|
* as defined below. The commands that are sent from interrupts must use the
|
||||||
* highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task
|
* highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task
|
||||||
* or interrupt version of the queue send function should be used. */
|
* or interrupt version of the queue send function should be used. */
|
||||||
#define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR ( ( BaseType_t ) -2 )
|
#define tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR ( ( BaseType_t ) -2 )
|
||||||
#define tmrCOMMAND_EXECUTE_CALLBACK ( ( BaseType_t ) -1 )
|
#define tmrCOMMAND_EXECUTE_CALLBACK ( ( BaseType_t ) -1 )
|
||||||
#define tmrCOMMAND_START_DONT_TRACE ( ( BaseType_t ) 0 )
|
#define tmrCOMMAND_START_DONT_TRACE ( ( BaseType_t ) 0 )
|
||||||
#define tmrCOMMAND_START ( ( BaseType_t ) 1 )
|
#define tmrCOMMAND_START ( ( BaseType_t ) 1 )
|
||||||
#define tmrCOMMAND_RESET ( ( BaseType_t ) 2 )
|
#define tmrCOMMAND_RESET ( ( BaseType_t ) 2 )
|
||||||
#define tmrCOMMAND_STOP ( ( BaseType_t ) 3 )
|
#define tmrCOMMAND_STOP ( ( BaseType_t ) 3 )
|
||||||
#define tmrCOMMAND_CHANGE_PERIOD ( ( BaseType_t ) 4 )
|
#define tmrCOMMAND_CHANGE_PERIOD ( ( BaseType_t ) 4 )
|
||||||
#define tmrCOMMAND_DELETE ( ( BaseType_t ) 5 )
|
#define tmrCOMMAND_DELETE ( ( BaseType_t ) 5 )
|
||||||
|
|
||||||
#define tmrFIRST_FROM_ISR_COMMAND ( ( BaseType_t ) 6 )
|
#define tmrFIRST_FROM_ISR_COMMAND ( ( BaseType_t ) 6 )
|
||||||
#define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 )
|
#define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 )
|
||||||
#define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 )
|
#define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 )
|
||||||
#define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 )
|
#define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 )
|
||||||
#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 )
|
#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -72,20 +74,20 @@
|
||||||
* reference the subject timer in calls to other software timer API functions
|
* reference the subject timer in calls to other software timer API functions
|
||||||
* (for example, xTimerStart(), xTimerReset(), etc.).
|
* (for example, xTimerStart(), xTimerReset(), etc.).
|
||||||
*/
|
*/
|
||||||
struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
struct tmrTimerControl; /* The old naming convention is used to prevent breaking kernel aware debuggers. */
|
||||||
typedef struct tmrTimerControl * TimerHandle_t;
|
typedef struct tmrTimerControl * TimerHandle_t;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines the prototype to which timer callback functions must conform.
|
* Defines the prototype to which timer callback functions must conform.
|
||||||
*/
|
*/
|
||||||
typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
|
typedef void (* TimerCallbackFunction_t)( TimerHandle_t xTimer );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines the prototype to which functions used with the
|
* Defines the prototype to which functions used with the
|
||||||
* xTimerPendFunctionCallFromISR() function must conform.
|
* xTimerPendFunctionCallFromISR() function must conform.
|
||||||
*/
|
*/
|
||||||
typedef void (* PendedFunction_t)( void *,
|
typedef void (* PendedFunction_t)( void *,
|
||||||
uint32_t );
|
uint32_t );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TimerHandle_t xTimerCreate( const char * const pcTimerName,
|
* TimerHandle_t xTimerCreate( const char * const pcTimerName,
|
||||||
|
@ -135,7 +137,7 @@
|
||||||
*
|
*
|
||||||
* @param pxCallbackFunction The function to call when the timer expires.
|
* @param pxCallbackFunction The function to call when the timer expires.
|
||||||
* Callback functions must have the prototype defined by TimerCallbackFunction_t,
|
* Callback functions must have the prototype defined by TimerCallbackFunction_t,
|
||||||
* which is "void vCallbackFunction( TimerHandle_t xTimer );".
|
* which is "void vCallbackFunction( TimerHandle_t xTimer );".
|
||||||
*
|
*
|
||||||
* @return If the timer is successfully created then a handle to the newly
|
* @return If the timer is successfully created then a handle to the newly
|
||||||
* created timer is returned. If the timer cannot be created because there is
|
* created timer is returned. If the timer cannot be created because there is
|
||||||
|
@ -224,13 +226,13 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||||
TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
TimerHandle_t xTimerCreate( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
const TickType_t xTimerPeriodInTicks,
|
const TickType_t xTimerPeriodInTicks,
|
||||||
const UBaseType_t uxAutoReload,
|
const UBaseType_t uxAutoReload,
|
||||||
void * const pvTimerID,
|
void * const pvTimerID,
|
||||||
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
|
TimerCallbackFunction_t pxCallbackFunction ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,
|
* TimerHandle_t xTimerCreateStatic(const char * const pcTimerName,
|
||||||
|
@ -354,14 +356,14 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||||
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
TimerHandle_t xTimerCreateStatic( const char * const pcTimerName, /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
const TickType_t xTimerPeriodInTicks,
|
const TickType_t xTimerPeriodInTicks,
|
||||||
const UBaseType_t uxAutoReload,
|
const UBaseType_t uxAutoReload,
|
||||||
void * const pvTimerID,
|
void * const pvTimerID,
|
||||||
TimerCallbackFunction_t pxCallbackFunction,
|
TimerCallbackFunction_t pxCallbackFunction,
|
||||||
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
|
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
|
||||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* void *pvTimerGetTimerID( TimerHandle_t xTimer );
|
* void *pvTimerGetTimerID( TimerHandle_t xTimer );
|
||||||
|
@ -383,7 +385,7 @@
|
||||||
*
|
*
|
||||||
* See the xTimerCreate() API function example usage scenario.
|
* See the xTimerCreate() API function example usage scenario.
|
||||||
*/
|
*/
|
||||||
void * pvTimerGetTimerID( const TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
void * pvTimerGetTimerID( const TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
|
* void vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
|
||||||
|
@ -404,8 +406,8 @@
|
||||||
*
|
*
|
||||||
* See the xTimerCreate() API function example usage scenario.
|
* See the xTimerCreate() API function example usage scenario.
|
||||||
*/
|
*/
|
||||||
void vTimerSetTimerID( TimerHandle_t xTimer,
|
void vTimerSetTimerID( TimerHandle_t xTimer,
|
||||||
void * pvNewID ) PRIVILEGED_FUNCTION;
|
void * pvNewID ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );
|
* BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer );
|
||||||
|
@ -442,7 +444,7 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
BaseType_t xTimerIsTimerActive( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
|
* TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
|
||||||
|
@ -450,7 +452,7 @@
|
||||||
* Simply returns the handle of the timer service/daemon task. It it not valid
|
* Simply returns the handle of the timer service/daemon task. It it not valid
|
||||||
* to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started.
|
* to call xTimerGetTimerDaemonTaskHandle() before the scheduler has been started.
|
||||||
*/
|
*/
|
||||||
TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerStart( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
* BaseType_t xTimerStart( TimerHandle_t xTimer, TickType_t xTicksToWait );
|
||||||
|
@ -502,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 );
|
||||||
|
@ -544,12 +547,13 @@
|
||||||
* 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,
|
||||||
* TickType_t xNewPeriod,
|
* TickType_t xNewPeriod,
|
||||||
* TickType_t xTicksToWait );
|
* TickType_t xTicksToWait );
|
||||||
*
|
*
|
||||||
* Timer functionality is provided by a timer service/daemon task. Many of the
|
* Timer functionality is provided by a timer service/daemon task. Many of the
|
||||||
* public FreeRTOS timer API functions send commands to the timer service task
|
* public FreeRTOS timer API functions send commands to the timer service task
|
||||||
|
@ -624,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 );
|
||||||
|
@ -662,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 );
|
||||||
|
@ -786,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,
|
||||||
|
@ -872,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,
|
||||||
|
@ -935,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,
|
||||||
|
@ -1008,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,
|
||||||
|
@ -1094,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 )
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1185,10 +1196,10 @@
|
||||||
* }
|
* }
|
||||||
* @endverbatim
|
* @endverbatim
|
||||||
*/
|
*/
|
||||||
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
|
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend,
|
||||||
void * pvParameter1,
|
void * pvParameter1,
|
||||||
uint32_t ulParameter2,
|
uint32_t ulParameter2,
|
||||||
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
BaseType_t * pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
* BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||||
|
@ -1222,10 +1233,10 @@
|
||||||
* timer daemon task, otherwise pdFALSE is returned.
|
* timer daemon task, otherwise pdFALSE is returned.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend,
|
||||||
void * pvParameter1,
|
void * pvParameter1,
|
||||||
uint32_t ulParameter2,
|
uint32_t ulParameter2,
|
||||||
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* const char * const pcTimerGetName( TimerHandle_t xTimer );
|
* const char * const pcTimerGetName( TimerHandle_t xTimer );
|
||||||
|
@ -1236,7 +1247,7 @@
|
||||||
*
|
*
|
||||||
* @return The name assigned to the timer specified by the xTimer parameter.
|
* @return The name assigned to the timer specified by the xTimer parameter.
|
||||||
*/
|
*/
|
||||||
const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );
|
* void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );
|
||||||
|
@ -1253,8 +1264,8 @@
|
||||||
* uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
* uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and
|
||||||
* enter the dormant state after it expires.
|
* enter the dormant state after it expires.
|
||||||
*/
|
*/
|
||||||
void vTimerSetReloadMode( TimerHandle_t xTimer,
|
void vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||||
const UBaseType_t uxAutoReload ) PRIVILEGED_FUNCTION;
|
const UBaseType_t uxAutoReload ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );
|
* UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer );
|
||||||
|
@ -1268,7 +1279,7 @@
|
||||||
* @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
|
* @return If the timer is an auto-reload timer then pdTRUE is returned, otherwise
|
||||||
* pdFALSE is returned.
|
* pdFALSE is returned.
|
||||||
*/
|
*/
|
||||||
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxTimerGetReloadMode( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TickType_t xTimerGetPeriod( TimerHandle_t xTimer );
|
* TickType_t xTimerGetPeriod( TimerHandle_t xTimer );
|
||||||
|
@ -1279,7 +1290,7 @@
|
||||||
*
|
*
|
||||||
* @return The period of the timer in ticks.
|
* @return The period of the timer in ticks.
|
||||||
*/
|
*/
|
||||||
TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
TickType_t xTimerGetPeriod( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer );
|
* TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer );
|
||||||
|
@ -1294,26 +1305,28 @@
|
||||||
* will next expire is returned. If the timer is not running then the return
|
* will next expire is returned. If the timer is not running then the return
|
||||||
* value is undefined.
|
* value is undefined.
|
||||||
*/
|
*/
|
||||||
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions beyond this part are not part of the public API and are intended
|
* Functions beyond this part are not part of the public API and are intended
|
||||||
* for use by the kernel only.
|
* for use by the kernel only.
|
||||||
*/
|
*/
|
||||||
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
|
BaseType_t xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION;
|
||||||
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
|
BaseType_t xTimerGenericCommand( TimerHandle_t xTimer,
|
||||||
const BaseType_t xCommandID,
|
const BaseType_t xCommandID,
|
||||||
const TickType_t xOptionalValue,
|
const TickType_t xOptionalValue,
|
||||||
BaseType_t * const pxHigherPriorityTaskWoken,
|
BaseType_t * const pxHigherPriorityTaskWoken,
|
||||||
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
|
||||||
|
|
||||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||||
void vTimerSetTimerNumber( TimerHandle_t xTimer,
|
void vTimerSetTimerNumber( TimerHandle_t xTimer,
|
||||||
UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxTimerNumber ) PRIVILEGED_FUNCTION;
|
||||||
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
UBaseType_t uxTimerGetTimerNumber( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/* *INDENT-OFF* */
|
||||||
}
|
#ifdef __cplusplus
|
||||||
#endif
|
}
|
||||||
|
#endif
|
||||||
|
/* *INDENT-ON* */
|
||||||
#endif /* TIMERS_H */
|
#endif /* TIMERS_H */
|
||||||
|
|
18
queue.c
18
queue.c
|
@ -1000,7 +1000,7 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
||||||
* assigned a priority above the configured maximum system call priority.
|
* assigned a priority above the configured maximum system call priority.
|
||||||
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
||||||
* that have been assigned a priority at or (logically) below the maximum
|
* that have been assigned a priority at or (logically) below the maximum
|
||||||
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
||||||
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
||||||
* More information (albeit Cortex-M specific) is provided on the following
|
* More information (albeit Cortex-M specific) is provided on the following
|
||||||
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
||||||
|
@ -1096,7 +1096,7 @@ BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
|
||||||
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
||||||
{
|
{
|
||||||
/* The task waiting has a higher priority so record that a
|
/* The task waiting has a higher priority so record that a
|
||||||
* context switch is required. */
|
* context switch is required. */
|
||||||
if( pxHigherPriorityTaskWoken != NULL )
|
if( pxHigherPriorityTaskWoken != NULL )
|
||||||
{
|
{
|
||||||
*pxHigherPriorityTaskWoken = pdTRUE;
|
*pxHigherPriorityTaskWoken = pdTRUE;
|
||||||
|
@ -1178,7 +1178,7 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||||
* assigned a priority above the configured maximum system call priority.
|
* assigned a priority above the configured maximum system call priority.
|
||||||
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
||||||
* that have been assigned a priority at or (logically) below the maximum
|
* that have been assigned a priority at or (logically) below the maximum
|
||||||
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
||||||
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
||||||
* More information (albeit Cortex-M specific) is provided on the following
|
* More information (albeit Cortex-M specific) is provided on the following
|
||||||
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
||||||
|
@ -1216,8 +1216,8 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||||
if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
|
if( prvNotifyQueueSetContainer( pxQueue ) != pdFALSE )
|
||||||
{
|
{
|
||||||
/* The semaphore is a member of a queue set, and
|
/* The semaphore is a member of a queue set, and
|
||||||
* posting to the queue set caused a higher priority
|
* posting to the queue set caused a higher priority
|
||||||
* task to unblock. A context switch is required. */
|
* task to unblock. A context switch is required. */
|
||||||
if( pxHigherPriorityTaskWoken != NULL )
|
if( pxHigherPriorityTaskWoken != NULL )
|
||||||
{
|
{
|
||||||
*pxHigherPriorityTaskWoken = pdTRUE;
|
*pxHigherPriorityTaskWoken = pdTRUE;
|
||||||
|
@ -1267,7 +1267,7 @@ BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
|
||||||
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
||||||
{
|
{
|
||||||
/* The task waiting has a higher priority so record that a
|
/* The task waiting has a higher priority so record that a
|
||||||
* context switch is required. */
|
* context switch is required. */
|
||||||
if( pxHigherPriorityTaskWoken != NULL )
|
if( pxHigherPriorityTaskWoken != NULL )
|
||||||
{
|
{
|
||||||
*pxHigherPriorityTaskWoken = pdTRUE;
|
*pxHigherPriorityTaskWoken = pdTRUE;
|
||||||
|
@ -1846,7 +1846,7 @@ BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
|
||||||
* assigned a priority above the configured maximum system call priority.
|
* assigned a priority above the configured maximum system call priority.
|
||||||
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
||||||
* that have been assigned a priority at or (logically) below the maximum
|
* that have been assigned a priority at or (logically) below the maximum
|
||||||
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
||||||
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
||||||
* More information (albeit Cortex-M specific) is provided on the following
|
* More information (albeit Cortex-M specific) is provided on the following
|
||||||
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
||||||
|
@ -1942,7 +1942,7 @@ BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
|
||||||
* assigned a priority above the configured maximum system call priority.
|
* assigned a priority above the configured maximum system call priority.
|
||||||
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
* Only FreeRTOS functions that end in FromISR can be called from interrupts
|
||||||
* that have been assigned a priority at or (logically) below the maximum
|
* that have been assigned a priority at or (logically) below the maximum
|
||||||
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
* system call interrupt priority. FreeRTOS maintains a separate interrupt
|
||||||
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
* safe API to ensure interrupt entry is as fast and as simple as possible.
|
||||||
* More information (albeit Cortex-M specific) is provided on the following
|
* More information (albeit Cortex-M specific) is provided on the following
|
||||||
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
* link: http://www.freertos.org/RTOS-Cortex-M3-M4.html */
|
||||||
|
@ -2267,7 +2267,7 @@ static void prvUnlockQueue( Queue_t * const pxQueue )
|
||||||
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )
|
||||||
{
|
{
|
||||||
/* The task waiting has a higher priority so record that a
|
/* The task waiting has a higher priority so record that a
|
||||||
* context switch is required. */
|
* context switch is required. */
|
||||||
vTaskMissedYield();
|
vTaskMissedYield();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -537,54 +537,54 @@ size_t xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||||
configASSERT( xRequiredSpace > xDataLengthBytes );
|
configASSERT( xRequiredSpace > xDataLengthBytes );
|
||||||
|
|
||||||
/* In the case of the message buffer, one has to be able to write the complete message as opposed to
|
/* In the case of the message buffer, one has to be able to write the complete message as opposed to
|
||||||
* a stream buffer for semantic reasons. Check if it is physically possible to write the message given
|
* a stream buffer for semantic reasons. Check if it is physically possible to write the message given
|
||||||
* the length of the buffer. */
|
* the length of the buffer. */
|
||||||
if(xRequiredSpace > pxStreamBuffer->xLength)
|
if( xRequiredSpace > pxStreamBuffer->xLength )
|
||||||
{
|
{
|
||||||
/* The message could never be written because it is greater than the buffer length.
|
/* The message could never be written because it is greater than the buffer length.
|
||||||
* By setting xIsFeasable to FALSE, we skip over the following do..while loop, thus avoiding
|
* By setting xIsFeasable to FALSE, we skip over the following do..while loop, thus avoiding
|
||||||
* a deadlock. The call to 'prvWriteMessageToBuffer' toward the end of this function with
|
* a deadlock. The call to 'prvWriteMessageToBuffer' toward the end of this function with
|
||||||
* xRequiredSpace greater than xSpace will suffice in not writing anything to the internal buffer.
|
* xRequiredSpace greater than xSpace will suffice in not writing anything to the internal buffer.
|
||||||
* Now, the function will return 0 because the message could not be written. Should an error code be
|
* Now, the function will return 0 because the message could not be written. Should an error code be
|
||||||
* returned instead ??? In my opinion, probably.. But the return type doesn't allow for negative
|
* returned instead ??? In my opinion, probably.. But the return type doesn't allow for negative
|
||||||
* values to be returned. A confusion could exist to the caller. Returning 0 because a timeout occurred
|
* values to be returned. A confusion could exist to the caller. Returning 0 because a timeout occurred
|
||||||
* and a subsequent send attempts could eventually succeed, and returning 0 because a write could never
|
* and a subsequent send attempts could eventually succeed, and returning 0 because a write could never
|
||||||
* happen because of the size are two scenarios to me :/ */
|
* happen because of the size are two scenarios to me :/ */
|
||||||
xIsFeasible = pdFALSE;
|
xIsFeasible = pdFALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* It is possible to write the message completely in the buffer. This is the intended route.
|
/* It is possible to write the message completely in the buffer. This is the intended route.
|
||||||
* Let's continue with the regular timeout logic. */
|
* Let's continue with the regular timeout logic. */
|
||||||
xIsFeasible = pdTRUE;
|
xIsFeasible = pdTRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* In the case of the stream buffer, not being able to completely write the message in the buffer
|
/* In the case of the stream buffer, not being able to completely write the message in the buffer
|
||||||
* is an acceptable scenario, but it has to be dealt with properly */
|
* is an acceptable scenario, but it has to be dealt with properly */
|
||||||
if(xRequiredSpace > pxStreamBuffer->xLength)
|
if( xRequiredSpace > pxStreamBuffer->xLength )
|
||||||
{
|
{
|
||||||
/* Not enough buffer space. We will attempt to write as much as we can in this run
|
/* Not enough buffer space. We will attempt to write as much as we can in this run
|
||||||
* so that the caller can send the remaining in subsequent calls. We avoid a deadlock by
|
* so that the caller can send the remaining in subsequent calls. We avoid a deadlock by
|
||||||
* offering the possibility to take the 'else' branch in the 'if( xSpace < xRequiredSpace )'
|
* offering the possibility to take the 'else' branch in the 'if( xSpace < xRequiredSpace )'
|
||||||
* condition inside the following do..while loop */
|
* condition inside the following do..while loop */
|
||||||
xRequiredSpace = pxStreamBuffer->xLength;
|
xRequiredSpace = pxStreamBuffer->xLength;
|
||||||
|
|
||||||
/* TODO FIXME: Is there a check we should do with the xTriggerLevelBytes value ? */
|
/* TODO FIXME: Is there a check we should do with the xTriggerLevelBytes value ? */
|
||||||
|
|
||||||
/* With the adjustment to 'xRequiredSpace', the deadlock is avoided, thus it's now feasible. */
|
/* With the adjustment to 'xRequiredSpace', the deadlock is avoided, thus it's now feasible. */
|
||||||
xIsFeasible = pdTRUE;
|
xIsFeasible = pdTRUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* It is possible to write the message completely in the buffer. */
|
/* It is possible to write the message completely in the buffer. */
|
||||||
xIsFeasible = pdTRUE;
|
xIsFeasible = pdTRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Added check against xIsFeasible. If it's not feasible, don't even wait for notification, let the call to 'prvWriteMessageToBuffer' do nothing and return 0 */
|
/* Added check against xIsFeasible. If it's not feasible, don't even wait for notification, let the call to 'prvWriteMessageToBuffer' do nothing and return 0 */
|
||||||
if( xTicksToWait != ( TickType_t ) 0 && xIsFeasible == pdTRUE )
|
if( ( xTicksToWait != ( TickType_t ) 0 ) && ( xIsFeasible == pdTRUE ) )
|
||||||
{
|
{
|
||||||
vTaskSetTimeOutState( &xTimeOut );
|
vTaskSetTimeOutState( &xTimeOut );
|
||||||
|
|
||||||
|
|
4
tasks.c
4
tasks.c
|
@ -3308,7 +3308,7 @@ void vTaskInternalSetTimeOutState( TimeOut_t * const pxTimeOut )
|
||||||
BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||||
TickType_t * const pxTicksToWait )
|
TickType_t * const pxTicksToWait )
|
||||||
{
|
{
|
||||||
BaseType_t xReturn;
|
BaseType_t xReturn;
|
||||||
|
|
||||||
configASSERT( pxTimeOut );
|
configASSERT( pxTimeOut );
|
||||||
configASSERT( pxTicksToWait );
|
configASSERT( pxTicksToWait );
|
||||||
|
@ -3319,7 +3319,7 @@ BaseType_t xReturn;
|
||||||
const TickType_t xConstTickCount = xTickCount;
|
const TickType_t xConstTickCount = xTickCount;
|
||||||
const TickType_t xElapsedTime = xConstTickCount - pxTimeOut->xTimeOnEntering;
|
const TickType_t xElapsedTime = xConstTickCount - pxTimeOut->xTimeOnEntering;
|
||||||
|
|
||||||
#if( INCLUDE_xTaskAbortDelay == 1 )
|
#if ( INCLUDE_xTaskAbortDelay == 1 )
|
||||||
if( pxCurrentTCB->ucDelayAborted != ( uint8_t ) pdFALSE )
|
if( pxCurrentTCB->ucDelayAborted != ( uint8_t ) pdFALSE )
|
||||||
{
|
{
|
||||||
/* The delay was aborted, which is not the same as a time out,
|
/* The delay was aborted, which is not the same as a time out,
|
||||||
|
|
Loading…
Reference in a new issue