diff --git a/Source/include/FreeRTOS.h b/Source/include/FreeRTOS.h index 64b8f63d7..a6e1035c4 100644 --- a/Source/include/FreeRTOS.h +++ b/Source/include/FreeRTOS.h @@ -148,6 +148,10 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * ); #define configUSE_MUTEXES 0 #endif +#ifndef configUSE_TIMERS + #define configUSE_TIMERS 0 +#endif + #ifndef configUSE_COUNTING_SEMAPHORES #define configUSE_COUNTING_SEMAPHORES 0 #endif @@ -177,6 +181,26 @@ typedef portBASE_TYPE (*pdTASK_HOOK_CODE)( void * ); #define INCLUDE_xTaskResumeFromISR 1 #endif +/* The timers module relies on xTaskGetSchedulerState(). */ +#if configUSE_TIMERS == 1 + + #undef INCLUDE_xTaskGetSchedulerState + #define INCLUDE_xTaskGetSchedulerState 1 + + #ifndef configTIMER_TASK_PRIORITY + #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_PRIORITY must also be defined. + #endif /* configTIMER_TASK_PRIORITY */ + + #ifndef configTIMER_QUEUE_LENGTH + #error If configUSE_TIMERS is set to 1 then configTIMER_QUEUE_LENGTH must also be defined. + #endif /* configTIMER_QUEUE_LENGTH */ + + #ifndef configTIMER_TASK_STACK_DEPTH + #error If configUSE_TIMERS is set to 1 then configTIMER_TASK_STACK_DEPTH must also be defined. + #endif /* configTIMER_TASK_STACK_DEPTH */ + +#endif /* configUSE_TIMERS */ + #ifndef INCLUDE_xTaskGetSchedulerState #define INCLUDE_xTaskGetSchedulerState 0 #endif diff --git a/Source/include/list.h b/Source/include/list.h index 5a8b4399e..000dc6bf6 100644 --- a/Source/include/list.h +++ b/Source/include/list.h @@ -79,12 +79,6 @@ * \ingroup FreeRTOSIntro */ -/* - Changes from V4.3.1 - - + Included local const within listGET_OWNER_OF_NEXT_ENTRY() to assist - compiler with optimisation. Thanks B.R. -*/ #ifndef LIST_H #define LIST_H @@ -151,6 +145,15 @@ typedef struct xLIST */ #define listGET_LIST_ITEM_VALUE( pxListItem ) ( ( pxListItem )->xItemValue ) +/* + * Access macro the retrieve the value of the list item at the head of a given + * list. + * + * \page listGET_LIST_ITEM_VALUE listGET_LIST_ITEM_VALUE + * \ingroup LinkedList + */ +#define listGET_ITEM_VALUE_OF_HEAD_ENTRY( pxList ) ( (&( ( pxList )->xListEnd ))->pxNext->xItemValue ) + /* * Access macro to determine if a list contains any items. The macro will * only have the value true if the list is empty. diff --git a/Source/include/queue.h b/Source/include/queue.h index b044d04de..c199573c5 100644 --- a/Source/include/queue.h +++ b/Source/include/queue.h @@ -1250,7 +1250,8 @@ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex ); void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcName ); #endif - +/* Not a public API function, hence the 'Restricted' in the name. */ +void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait ); #ifdef __cplusplus diff --git a/Source/include/timers.h b/Source/include/timers.h index 21d905368..09db215b2 100644 --- a/Source/include/timers.h +++ b/Source/include/timers.h @@ -83,14 +83,15 @@ typedef void (*tmrTIMER_CALLBACK)( xTimerHandle xTimer ); portBASE_TYPE xTimerCreateTimerTask( void ) PRIVILEGED_FUNCTION; xTimerHandle xTimerCreate( const signed char *pcTimerName, portTickType xTimerPeriod, unsigned portBASE_TYPE uxAutoReload, void * pvTimerID, tmrTIMER_CALLBACK pxCallbackFunction ) PRIVILEGED_FUNCTION; -void *pvTimerGetTimerID( xTimerHandle xTimer ); -portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portTickType xBlockTime ); -portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer ); +void *pvTimerGetTimerID( xTimerHandle xTimer ) PRIVILEGED_FUNCTION; +portBASE_TYPE xTimerGenericCommand( xTimerHandle xTimer, portBASE_TYPE xCommandID, portTickType xOptionalValue, portTickType xBlockTime ) PRIVILEGED_FUNCTION; +portBASE_TYPE xTimerIsTimerActive( xTimerHandle xTimer ) PRIVILEGED_FUNCTION; #define xTimerStart( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, xBlockTime ) #define xTimerStop( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_STOP, 0, xBlockTime ) #define xTimerChangePeriod( xTimer, xNewPeriod, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_CHANGE_PERIOD, xNewPeriod, xBlockTime ) #define xTimerDelete( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_DELETE, 0, xBlockTime ) +#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( xTimer, tmrCOMMAND_START, 0, xBlockTime ) #ifdef __cplusplus }