+ The MPU port is not supported in this revision number.
+ The documentation for the static allocation functions in the header files has not yet been updated for this revision.

Kernel updates:
+ Simplify the static allocation of objects implementation.
+ Introduce configSUPPORT_DYNAMIC_ALLOCATION in addition to the existing configSUPPORT_STATIC_ALLOCATION so FreeRTOS can be built without providing a heap at all.

Demo application updates:
+ Update the demos to take into account the new configSUPPORT_DYNAMIC_ALLOCATION constant.
+ Add an MSVC demo that only uses static allocation, and does not include a FreeRTOS heap.
+ Update the MSVC project to use both configSUPPORT_STATIC_ALLOCATION and configSUPPORT_DYNAMIC_ALLOCATION.
+ Update the MingW project to use only configSUPPORT_DYNAMIC_ALLOCATION.
This commit is contained in:
Richard Barry 2016-03-22 16:23:37 +00:00
parent 283bc18d23
commit 6568ba6eb0
50 changed files with 2350 additions and 3914 deletions

View file

@ -398,13 +398,23 @@ uint32_t ulReturn;
static void prvTestAbortingEventGroupWait( void )
{
TickType_t xTimeAtStart;
static StaticEventGroup_t xEventGroupBuffer;
EventGroupHandle_t xEventGroup;
EventBits_t xBitsToWaitFor = ( EventBits_t ) 0x01, xReturn;
/* Create the event group. Statically allocated memory is used so the
creation cannot fail. */
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
{
static StaticEventGroup_t xEventGroupBuffer;
/* Create the event group. Statically allocated memory is used so the
creation cannot fail. */
xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );
}
#else
{
xEventGroup = xEventGroupCreate();
configASSERT( xEventGroup );
}
#endif
/* Note the time before the delay so the length of the delay is known. */
xTimeAtStart = xTaskGetTickCount();
@ -449,14 +459,25 @@ static void prvTestAbortingQueueSend( void )
{
TickType_t xTimeAtStart;
BaseType_t xReturn;
static StaticQueue_t xQueueBuffer;
static uint8_t ucQueueStorage[ sizeof( uint8_t ) ], ucItemToQueue;
const UBaseType_t xQueueLength = ( UBaseType_t ) 1;
QueueHandle_t xQueue;
uint8_t ucItemToQueue;
/* Create the queue. Statically allocated memory is used so the
creation cannot fail. */
xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
{
static StaticQueue_t xQueueBuffer;
static uint8_t ucQueueStorage[ sizeof( uint8_t ) ];
/* Create the queue. Statically allocated memory is used so the
creation cannot fail. */
xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );
}
#else
{
xQueue = xQueueCreate( xQueueLength, sizeof( uint8_t ) );
configASSERT( xQueue );
}
#endif
/* This function tests aborting when in the blocked state waiting to send,
so the queue must be full. There is only one space in the queue. */
@ -509,12 +530,21 @@ static void prvTestAbortingSemaphoreTake( void )
{
TickType_t xTimeAtStart;
BaseType_t xReturn;
static StaticSemaphore_t xSemaphoreBuffer;
SemaphoreHandle_t xSemaphore;
/* Create the semaphore. Statically allocated memory is used so the
creation cannot fail. */
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
{
static StaticSemaphore_t xSemaphoreBuffer;
/* Create the semaphore. Statically allocated memory is used so the
creation cannot fail. */
xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
}
#else
{
xSemaphore = xSemaphoreCreateBinary();
}
#endif
/* Note the time before the delay so the length of the delay is known. */
xTimeAtStart = xTaskGetTickCount();

View file

@ -104,6 +104,10 @@
#define blckqSTACK_SIZE configMINIMAL_STACK_SIZE
#define blckqNUM_TASK_SETS ( 3 )
#if( configSUPPORT_DYNAMIC_ALLOCATION == 0 )
#error This example cannot be used if dynamic allocation is not allowed.
#endif
/* Structure used to pass parameters to the blocking queue tasks. */
typedef struct BLOCKING_QUEUE_PARAMETERS
{

View file

@ -154,36 +154,42 @@ SemaphoreHandle_t xMutex;
prvSendFrontAndBackTest demo. */
xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( uint32_t ) );
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xQueue, "Gen_Queue_Test" );
if( xQueue != NULL )
{
/* vQueueAddToRegistry() adds the queue to the queue registry, if one
is in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xQueue, "Gen_Queue_Test" );
/* Create the demo task and pass it the queue just created. We are
passing the queue handle by value so it does not matter that it is
declared on the stack here. */
xTaskCreate( prvSendFrontAndBackTest, "GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );
/* Create the demo task and pass it the queue just created. We are
passing the queue handle by value so it does not matter that it is
declared on the stack here. */
xTaskCreate( prvSendFrontAndBackTest, "GenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );
}
/* Create the mutex used by the prvMutexTest task. */
xMutex = xSemaphoreCreateMutex();
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate mutexes and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Gen_Queue_Mutex" );
if( xMutex != NULL )
{
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate mutexes and has no purpose if a kernel aware
debugger is not being used. The call to vQueueAddToRegistry() will be
removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not
defined or is defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Gen_Queue_Mutex" );
/* Create the mutex demo tasks and pass it the mutex just created. We are
passing the mutex handle by value so it does not matter that it is declared
on the stack here. */
xTaskCreate( prvLowPriorityMutexTask, "MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );
xTaskCreate( prvMediumPriorityMutexTask, "MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );
xTaskCreate( prvHighPriorityMutexTask, "MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );
/* Create the mutex demo tasks and pass it the mutex just created. We
are passing the mutex handle by value so it does not matter that it is
declared on the stack here. */
xTaskCreate( prvLowPriorityMutexTask, "MuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );
xTaskCreate( prvMediumPriorityMutexTask, "MuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );
xTaskCreate( prvHighPriorityMutexTask, "MuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );
}
}
/*-----------------------------------------------------------*/

View file

@ -134,17 +134,20 @@ static QueueHandle_t xPolledQueue;
/* Create the queue used by the producer and consumer. */
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );
if( xPolledQueue != NULL )
{
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );
/* Spawn the producer and consumer. */
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
/* Spawn the producer and consumer. */
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
}
}
/*-----------------------------------------------------------*/

View file

@ -127,21 +127,24 @@ QueueHandle_t xQueue;
/* Create the queue that we are going to use for the test/demo. */
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( uint32_t ) );
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xQueue, "QPeek_Test_Queue" );
if( xQueue != NULL )
{
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xQueue, "QPeek_Test_Queue" );
/* Create the demo tasks and pass it the queue just created. We are
passing the queue handle by value so it does not matter that it is declared
on the stack here. */
xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL );
xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask );
xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask );
xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask );
/* Create the demo tasks and pass it the queue just created. We are
passing the queue handle by value so it does not matter that it is declared
on the stack here. */
xTaskCreate( prvLowPriorityPeekTask, "PeekL", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekLOW_PRIORITY, NULL );
xTaskCreate( prvMediumPriorityPeekTask, "PeekM", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekMEDIUM_PRIORITY, &xMediumPriorityTask );
xTaskCreate( prvHighPriorityPeekTask, "PeekH1", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGH_PRIORITY, &xHighPriorityTask );
xTaskCreate( prvHighestPriorityPeekTask, "PeekH2", configMINIMAL_STACK_SIZE, ( void * ) xQueue, qpeekHIGHEST_PRIORITY, &xHighestPriorityTask );
}
}
/*-----------------------------------------------------------*/

View file

@ -234,14 +234,18 @@ void vStartQueueSetTasks( void )
{
/* Create the tasks. */
xTaskCreate( prvQueueSetSendingTask, "SetTx", configMINIMAL_STACK_SIZE, NULL, queuesetMEDIUM_PRIORITY, &xQueueSetSendingTask );
xTaskCreate( prvQueueSetReceivingTask, "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, &xQueueSetReceivingTask );
/* It is important that the sending task does not attempt to write to a
queue before the queue has been created. It is therefore placed into the
suspended state before the scheduler has started. It is resumed by the
receiving task after the receiving task has created the queues and added the
queues to the queue set. */
vTaskSuspend( xQueueSetSendingTask );
if( xQueueSetSendingTask != NULL )
{
xTaskCreate( prvQueueSetReceivingTask, "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, &xQueueSetReceivingTask );
/* It is important that the sending task does not attempt to write to a
queue before the queue has been created. It is therefore placed into
the suspended state before the scheduler has started. It is resumed by
the receiving task after the receiving task has created the queues and
added the queues to the queue set. */
vTaskSuspend( xQueueSetSendingTask );
}
}
/*-----------------------------------------------------------*/

View file

@ -130,10 +130,14 @@ void vStartQueueSetPollingTask( void )
the set. */
xQueue = xQueueCreate( setpollQUEUE_LENGTH, sizeof( uint32_t ) );
xQueueSet = xQueueCreateSet( setpollQUEUE_LENGTH );
xQueueAddToSet( xQueue, xQueueSet );
/* Create the task. */
xTaskCreate( prvQueueSetReceivingTask, "SetPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
if( ( xQueue != NULL ) && ( xQueueSet != NULL ) )
{
xQueueAddToSet( xQueue, xQueueSet );
/* Create the task. */
xTaskCreate( prvQueueSetReceivingTask, "SetPoll", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
}
}
/*-----------------------------------------------------------*/

View file

@ -279,10 +279,25 @@ static void prvStaticallyAllocatedCreator( void *pvParameters )
allocation. */
prvCreateAndDeleteStaticallyAllocatedTasks();
prvCreateAndDeleteStaticallyAllocatedQueues();
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
prvCreateAndDeleteStaticallyAllocatedBinarySemaphores();
prvCreateAndDeleteStaticallyAllocatedCountingSemaphores();
vTaskDelay( prvGetNextDelayTime() );
uxCycleCounter++;
prvCreateAndDeleteStaticallyAllocatedMutexes();
prvCreateAndDeleteStaticallyAllocatedRecursiveMutexes();
vTaskDelay( prvGetNextDelayTime() );
uxCycleCounter++;
prvCreateAndDeleteStaticallyAllocatedEventGroups();
prvCreateAndDeleteStaticallyAllocatedTimers();
}
@ -553,25 +568,6 @@ StaticSemaphore_t xSemaphoreBuffer;
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* The semaphore created above had a statically allocated semaphore
structure. Repeat the above using NULL as the third
xSemaphoreCreateCountingStatic() parameter so the semaphore structure is
instead allocated dynamically. */
xSemaphore = xSemaphoreCreateCountingStatic( uxMaxCount, 0, NULL );
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedSemaphore( xSemaphore, uxMaxCount );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -606,25 +602,6 @@ StaticSemaphore_t xSemaphoreBuffer;
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* The semaphore created above had a statically allocated semaphore
structure. Repeat the above using NULL as the
xSemaphoreCreateRecursiveMutexStatic() parameter so the semaphore structure
is instead allocated dynamically. */
xSemaphore = xSemaphoreCreateRecursiveMutexStatic( NULL );
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedRecursiveMutex( xSemaphore );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -649,11 +626,11 @@ http://www.freertos.org/Embedded-RTOS-Queues.html */
static uint8_t ucQueueStorageArea[ staticQUEUE_LENGTH_IN_ITEMS * sizeof( uint64_t ) ];
/* Create the queue. xQueueCreateStatic() has two more parameters than the
usual xQueueCreate() function. The first new paraemter is a pointer to the
usual xQueueCreate() function. The first new parameter is a pointer to the
pre-allocated queue storage area. The second new parameter is a pointer to
the StaticQueue_t structure that will hold the queue state information in
an anonymous way. If either pointer is passed as NULL then the respective
data will be allocated dynamically as if xQueueCreate() had been called. */
an anonymous way. If the two pointers are passed as NULL then the data
will be allocated dynamically as if xQueueCreate() had been called. */
xQueue = xQueueCreateStatic( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ), /* The size of each item. */
ucQueueStorageArea, /* The buffer used to hold items within the queue. */
@ -668,48 +645,6 @@ static uint8_t ucQueueStorageArea[ staticQUEUE_LENGTH_IN_ITEMS * sizeof( uint64_
/* Delete the queue again so the buffers can be reused. */
vQueueDelete( xQueue );
/* The queue created above had a statically allocated queue storage area and
queue structure. Repeat the above with three more times - with different
combinations of static and dynamic allocation. */
xQueue = xQueueCreateStatic( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ), /* The size of each item. */
NULL, /* Allocate the buffer used to hold items within the queue dynamically. */
&xStaticQueue ); /* The static queue structure that will hold the state of the queue. */
configASSERT( xQueue == ( QueueHandle_t ) &xStaticQueue );
prvSanityCheckCreatedQueue( xQueue );
vQueueDelete( xQueue );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
xQueue = xQueueCreateStatic( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ), /* The size of each item. */
ucQueueStorageArea, /* The buffer used to hold items within the queue. */
NULL ); /* The queue structure is allocated dynamically. */
prvSanityCheckCreatedQueue( xQueue );
vQueueDelete( xQueue );
xQueue = xQueueCreateStatic( staticQUEUE_LENGTH_IN_ITEMS, /* The maximum number of items the queue can hold. */
sizeof( uint64_t ), /* The size of each item. */
NULL, /* Allocate the buffer used to hold items within the queue dynamically. */
NULL ); /* The queue structure is allocated dynamically. */
prvSanityCheckCreatedQueue( xQueue );
vQueueDelete( xQueue );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -753,33 +688,6 @@ StaticSemaphore_t xSemaphoreBuffer;
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* The semaphore created above had a statically allocated semaphore
structure. Repeat the above using NULL as the xSemaphoreCreateMutexStatic()
parameter so the semaphore structure is instead allocated dynamically. */
xSemaphore = xSemaphoreCreateMutexStatic( NULL );
/* Take the mutex so the mutex is in the state expected by the
prvSanityCheckCreatedSemaphore() function. */
xReturned = xSemaphoreTake( xSemaphore, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -817,40 +725,25 @@ StaticSemaphore_t xSemaphoreBuffer;
vSemaphoreDelete( xSemaphore );
/* The semaphore created above had a statically allocated semaphore
structure. Repeat the above using NULL as the xSemaphoreCreateBinaryStatic()
parameter so the semaphore structure is instead allocated dynamically. */
xSemaphore = xSemaphoreCreateBinaryStatic( NULL );
/* Ensure the semaphore passes a few sanity checks as a valid semaphore. */
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
/* Delete the semaphore again so the buffers can be reused. */
vSemaphoreDelete( xSemaphore );
/* There isn't a static version of the old and deprecated
vSemaphoreCreateBinary() macro (because its deprecated!), but check it is
still functioning correctly when configSUPPORT_STATIC_ALLOCATION is set to
1. */
vSemaphoreCreateBinary( xSemaphore );
/* The macro starts with the binary semaphore available, but the test
function expects it to be unavailable. */
if( xSemaphoreTake( xSemaphore, staticDONT_BLOCK ) == pdFAIL )
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
{
xErrorOccurred = pdTRUE;
vSemaphoreCreateBinary( xSemaphore );
/* The macro starts with the binary semaphore available, but the test
function expects it to be unavailable. */
if( xSemaphoreTake( xSemaphore, staticDONT_BLOCK ) == pdFAIL )
{
xErrorOccurred = pdTRUE;
}
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
}
prvSanityCheckCreatedSemaphore( xSemaphore, staticBINARY_SEMAPHORE_MAX_COUNT );
vSemaphoreDelete( xSemaphore );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
#endif
}
/*-----------------------------------------------------------*/
@ -945,43 +838,6 @@ StaticTimer_t xTimerBuffer;
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
/* The software timer created above had a statically allocated timer
structure. Repeat the above using NULL as the xTimerCreateStatic()
parameter so the timer structure is instead allocated dynamically. */
xTimer = xTimerCreateStatic( "T1", /* Text name for the task. Helps debugging only. Not used by FreeRTOS. */
xTimerPeriod, /* The period of the timer in ticks. */
pdTRUE, /* This is an auto-reload timer. */
( void * ) &uxVariableToIncrement, /* The variable incremented by the test is passed into the timer callback using the timer ID. */
prvTimerCallback, /* The function to execute when the timer expires. */
NULL ); /* A buffer is not passed this time, so the timer should be allocated dynamically. */
uxVariableToIncrement = 0;
xReturned = xTimerStart( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelay( xTimerPeriod * staticMAX_TIMER_CALLBACK_EXECUTIONS );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
if( uxVariableToIncrement != staticMAX_TIMER_CALLBACK_EXECUTIONS )
{
xErrorOccurred = pdTRUE;
}
xReturned = xTimerDelete( xTimer, staticDONT_BLOCK );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -1015,25 +871,6 @@ StaticEventGroup_t xEventGroupBuffer;
/* Delete the event group again so the buffers can be reused. */
vEventGroupDelete( xEventGroup );
/* The event group created above had a statically allocated event group
structure. Repeat the above using NULL as the xEventGroupCreateStatic()
parameter so the event group structure is instead allocated dynamically. */
xEventGroup = xEventGroupCreateStatic( NULL );
/* Ensure the event group passes a few sanity checks as a valid event
group. */
prvSanityCheckCreatedEventGroup( xEventGroup );
/* Delete the event group again so the buffers can be reused. */
vEventGroupDelete( xEventGroup );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/
@ -1055,7 +892,7 @@ static StackType_t uxStackBuffer[ configMINIMAL_STACK_SIZE ];
/* Create the task. xTaskCreateStatic() has two more parameters than
the usual xTaskCreate() function. The first new parameter is a pointer to
the pre-allocated stack. The second new parameter is a pointer to the
StaticTask_t structure that will hold the task's TCB. If either pointer is
StaticTask_t structure that will hold the task's TCB. If both pointers are
passed as NULL then the respective object will be allocated dynamically as
if xTaskCreate() had been called. */
xReturned = xTaskCreateStatic(
@ -1075,77 +912,6 @@ static StackType_t uxStackBuffer[ configMINIMAL_STACK_SIZE ];
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Create and delete the task a few times again - testing both static and
dynamic allocation for the stack and TCB. */
xReturned = xTaskCreateStatic(
prvStaticallyAllocatedTask, /* Function that implements the task. */
"Static", /* Human readable name for the task. */
configMINIMAL_STACK_SIZE, /* Task's stack size, in words (not bytes!). */
NULL, /* Parameter to pass into the task. */
staticTASK_PRIORITY + 1, /* The priority of the task. */
&xCreatedTask, /* Handle of the task being created. */
NULL, /* This time, dynamically allocate the stack. */
&xTCBBuffer ); /* The variable that will hold that task's TCB. */
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
xReturned = xTaskCreateStatic(
prvStaticallyAllocatedTask, /* Function that implements the task. */
"Static", /* Human readable name for the task. */
configMINIMAL_STACK_SIZE, /* Task's stack size, in words (not bytes!). */
NULL, /* Parameter to pass into the task. */
staticTASK_PRIORITY - 1, /* The priority of the task. */
&xCreatedTask, /* Handle of the task being created. */
&( uxStackBuffer[ 0 ] ), /* The buffer to use as the task's stack. */
NULL ); /* This time dynamically allocate the TCB. */
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
xReturned = xTaskCreateStatic(
prvStaticallyAllocatedTask, /* Function that implements the task. */
"Static", /* Human readable name for the task. */
configMINIMAL_STACK_SIZE, /* Task's stack size, in words (not bytes!). */
NULL, /* Parameter to pass into the task. */
staticTASK_PRIORITY, /* The priority of the task. */
&xCreatedTask, /* Handle of the task being created. */
NULL, /* This time dynamically allocate the stack and TCB. */
NULL ); /* This time dynamically allocate the stack and TCB. */
configASSERT( xReturned == pdPASS );
if( xReturned != pdPASS )
{
xErrorOccurred = pdTRUE;
}
vTaskDelete( xCreatedTask );
/* Ensure lower priority tasks get CPU time. */
vTaskDelay( prvGetNextDelayTime() );
/* Just to show the check task that this task is still executing. */
uxCycleCounter++;
}
/*-----------------------------------------------------------*/

View file

@ -285,18 +285,16 @@ TickType_t xTimer;
for( xTimer = 0; xTimer < configTIMER_QUEUE_LENGTH; xTimer++ )
{
/* As the timer queue is not yet full, it should be possible to both create
and start a timer. These timers are being started before the scheduler has
been started, so their block times should get set to zero within the timer
API itself. */
/* As the timer queue is not yet full, it should be possible to both
create and start a timer. These timers are being started before the
scheduler has been started, so their block times should get set to zero
within the timer API itself. */
xAutoReloadTimers[ xTimer ] = xTimerCreate( "FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */
( ( xTimer + ( TickType_t ) 1 ) * xBasePeriod ),/* The period for the timer. The plus 1 ensures a period of zero is not specified. */
pdTRUE, /* Auto-reload is set to true. */
( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */
prvAutoReloadTimerCallback ); /* The callback to be called when the timer expires. */
configASSERT( strcmp( pcTimerGetTimerName( xAutoReloadTimers[ xTimer ] ), "FR Timer" ) == 0 );
if( xAutoReloadTimers[ xTimer ] == NULL )
{
xTestStatus = pdFAIL;
@ -304,6 +302,8 @@ TickType_t xTimer;
}
else
{
configASSERT( strcmp( pcTimerGetTimerName( xAutoReloadTimers[ xTimer ] ), "FR Timer" ) == 0 );
/* The scheduler has not yet started, so the block period of
portMAX_DELAY should just get set to zero in xTimerStart(). Also,
the timer queue is not yet full so xTimerStart() should return
@ -402,7 +402,7 @@ UBaseType_t uxOriginalPriority;
in the Blocked state. */
uxOriginalPriority = uxTaskPriorityGet( NULL );
vTaskPrioritySet( NULL, ( configMAX_PRIORITIES - 1 ) );
/* Delaying for configTIMER_QUEUE_LENGTH * xBasePeriod ticks should allow
all the auto reload timers to expire at least once. */
xBlockPeriod = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;

View file

@ -134,19 +134,22 @@ static volatile UBaseType_t xRunIndicator;
void vCreateBlockTimeTasks( void )
{
/* Create the queue on which the two tasks block. */
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );
xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xTestQueue, "Block_Time_Queue" );
if( xTestQueue != NULL )
{
/* vQueueAddToRegistry() adds the queue to the queue registry, if one
is in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware
debugger is not being used. The call to vQueueAddToRegistry() will be
removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not
defined or is defined to be less than 1. */
vQueueAddToRegistry( xTestQueue, "Block_Time_Queue" );
/* Create the two test tasks. */
xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
/* Create the two test tasks. */
xTaskCreate( vPrimaryBlockTimeTestTask, "BTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );
xTaskCreate( vSecondaryBlockTimeTestTask, "BTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );
}
}
/*-----------------------------------------------------------*/

View file

@ -159,19 +159,18 @@ void vStartCountingSemaphoreTasks( void )
xParameters[ 1 ].uxExpectedStartCount = 0;
xParameters[ 1 ].uxLoopCounter = 0;
/* vQueueAddToRegistry() adds the semaphore to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate semaphores and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 0 ].xSemaphore, "Counting_Sem_1" );
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 1 ].xSemaphore, "Counting_Sem_2" );
/* Were the semaphores created? */
if( ( xParameters[ 0 ].xSemaphore != NULL ) || ( xParameters[ 1 ].xSemaphore != NULL ) )
{
/* vQueueAddToRegistry() adds the semaphore to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate semaphores and has no purpose if a kernel aware
debugger is not being used. The call to vQueueAddToRegistry() will be
removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not
defined or is defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 0 ].xSemaphore, "Counting_Sem_1" );
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 1 ].xSemaphore, "Counting_Sem_2" );
/* Create the demo tasks, passing in the semaphore to use as the parameter. */
xTaskCreate( prvCountingSemaphoreTask, "CNT1", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 0 ] ), tskIDLE_PRIORITY, NULL );
xTaskCreate( prvCountingSemaphoreTask, "CNT2", configMINIMAL_STACK_SIZE, ( void * ) &( xParameters[ 1 ] ), tskIDLE_PRIORITY, NULL );

View file

@ -129,14 +129,7 @@ TaskHandle_t xCreatedTask;
void vCreateSuicidalTasks( UBaseType_t uxPriority )
{
UBaseType_t *puxPriority;
/* Create the Creator tasks - passing in as a parameter the priority at which
the suicidal tasks should be created. */
puxPriority = ( UBaseType_t * ) pvPortMalloc( sizeof( UBaseType_t ) );
*puxPriority = uxPriority;
xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );
xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) NULL, uxPriority, NULL );
/* Record the number of tasks that are running now so we know if any of the
suicidal tasks have failed to be killed. */
@ -206,8 +199,10 @@ static portTASK_FUNCTION( vCreateTasks, pvParameters )
const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 1000 );
UBaseType_t uxPriority;
uxPriority = *( UBaseType_t * ) pvParameters;
vPortFree( pvParameters );
/* Remove compiler warning about unused parameter. */
( void ) pvParameters;
uxPriority = uxTaskPriorityGet( NULL );
for( ;; )
{

View file

@ -189,19 +189,22 @@ void vStartDynamicPriorityTasks( void )
{
xSuspendedTestQueue = xQueueCreate( priSUSPENDED_QUEUE_LENGTH, sizeof( uint32_t ) );
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xSuspendedTestQueue, "Suspended_Test_Queue" );
if( xSuspendedTestQueue != NULL )
{
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is
in use. The queue registry is provided as a means for kernel aware
debuggers to locate queues and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( xSuspendedTestQueue, "Suspended_Test_Queue" );
xTaskCreate( vContinuousIncrementTask, "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinuousIncrementHandle );
xTaskCreate( vLimitedIncrementTask, "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );
xTaskCreate( vCounterControlTask, "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vQueueSendWhenSuspendedTask, "SUSP_TX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vContinuousIncrementTask, "CNT_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY, &xContinuousIncrementHandle );
xTaskCreate( vLimitedIncrementTask, "LIM_INC", priSTACK_SIZE, ( void * ) &ulCounter, tskIDLE_PRIORITY + 1, &xLimitedIncrementHandle );
xTaskCreate( vCounterControlTask, "C_CTRL", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vQueueSendWhenSuspendedTask, "SUSP_TX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( vQueueReceiveWhenSuspendedTask, "SUSP_RX", priSTACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
}
}
/*-----------------------------------------------------------*/

View file

@ -151,20 +151,19 @@ void vStartRecursiveMutexTasks( void )
xMutex = xSemaphoreCreateRecursiveMutex();
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate mutex and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" );
if( xMutex != NULL )
{
/* vQueueAddToRegistry() adds the mutex to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate mutex and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" );
xTaskCreate( prvRecursiveMutexControllingTask, "Rec1", configMINIMAL_STACK_SIZE, NULL, recmuCONTROLLING_TASK_PRIORITY, &xControllingTaskHandle );
xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );
xTaskCreate( prvRecursiveMutexPollingTask, "Rec3", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );
xTaskCreate( prvRecursiveMutexBlockingTask, "Rec2", configMINIMAL_STACK_SIZE, NULL, recmuBLOCKING_TASK_PRIORITY, &xBlockingTaskHandle );
xTaskCreate( prvRecursiveMutexPollingTask, "Rec3", configMINIMAL_STACK_SIZE, NULL, recmuPOLLING_TASK_PRIORITY, NULL );
}
}
/*-----------------------------------------------------------*/

View file

@ -68,24 +68,24 @@
*/
/*
* Creates two sets of two tasks. The tasks within a set share a variable, access
* Creates two sets of two tasks. The tasks within a set share a variable, access
* to which is guarded by a semaphore.
*
* Each task starts by attempting to obtain the semaphore. On obtaining a
* semaphore a task checks to ensure that the guarded variable has an expected
* value. It then clears the variable to zero before counting it back up to the
* expected value in increments of 1. After each increment the variable is checked
* to ensure it contains the value to which it was just set. When the starting
* value is again reached the task releases the semaphore giving the other task in
* the set a chance to do exactly the same thing. The starting value is high
*
* Each task starts by attempting to obtain the semaphore. On obtaining a
* semaphore a task checks to ensure that the guarded variable has an expected
* value. It then clears the variable to zero before counting it back up to the
* expected value in increments of 1. After each increment the variable is checked
* to ensure it contains the value to which it was just set. When the starting
* value is again reached the task releases the semaphore giving the other task in
* the set a chance to do exactly the same thing. The starting value is high
* enough to ensure that a tick is likely to occur during the incrementing loop.
*
* An error is flagged if at any time during the process a shared variable is
* found to have a value other than that expected. Such an occurrence would
* suggest an error in the mutual exclusion mechanism by which access to the
* An error is flagged if at any time during the process a shared variable is
* found to have a value other than that expected. Such an occurrence would
* suggest an error in the mutual exclusion mechanism by which access to the
* variable is restricted.
*
* The first set of two tasks poll their semaphore. The second set use blocking
* The first set of two tasks poll their semaphore. The second set use blocking
* calls.
*
*/
@ -139,11 +139,12 @@ const TickType_t xBlockTime = ( TickType_t ) 100;
if( pxFirstSemaphoreParameters != NULL )
{
/* Create the semaphore used by the first two tasks. */
pxFirstSemaphoreParameters->xSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive( pxFirstSemaphoreParameters->xSemaphore );
pxFirstSemaphoreParameters->xSemaphore = xSemaphoreCreateBinary();
if( pxFirstSemaphoreParameters->xSemaphore != NULL )
{
xSemaphoreGive( pxFirstSemaphoreParameters->xSemaphore );
/* Create the variable which is to be shared by the first two tasks. */
pxFirstSemaphoreParameters->pulSharedVariable = ( uint32_t * ) pvPortMalloc( sizeof( uint32_t ) );
@ -156,36 +157,44 @@ const TickType_t xBlockTime = ( TickType_t ) 100;
/* Spawn the first two tasks. As they poll they operate at the idle priority. */
xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
/* vQueueAddToRegistry() adds the semaphore to the registry, if one
is in use. The registry is provided as a means for kernel aware
debuggers to locate semaphores and has no purpose if a kernel aware
debugger is not being used. The call to vQueueAddToRegistry() will
be removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not
defined or is defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) pxFirstSemaphoreParameters->xSemaphore, "Counting_Sem_1" );
}
}
/* Do exactly the same to create the second set of tasks, only this time
/* Do exactly the same to create the second set of tasks, only this time
provide a block time for the semaphore calls. */
pxSecondSemaphoreParameters = ( xSemaphoreParameters * ) pvPortMalloc( sizeof( xSemaphoreParameters ) );
if( pxSecondSemaphoreParameters != NULL )
{
pxSecondSemaphoreParameters->xSemaphore = xSemaphoreCreateBinary();
xSemaphoreGive( pxSecondSemaphoreParameters->xSemaphore );
pxSecondSemaphoreParameters->xSemaphore = xSemaphoreCreateBinary();
if( pxSecondSemaphoreParameters->xSemaphore != NULL )
{
xSemaphoreGive( pxSecondSemaphoreParameters->xSemaphore );
pxSecondSemaphoreParameters->pulSharedVariable = ( uint32_t * ) pvPortMalloc( sizeof( uint32_t ) );
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;
xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
/* vQueueAddToRegistry() adds the semaphore to the registry, if one
is in use. The registry is provided as a means for kernel aware
debuggers to locate semaphores and has no purpose if a kernel aware
debugger is not being used. The call to vQueueAddToRegistry() will
be removed by the pre-processor if configQUEUE_REGISTRY_SIZE is not
defined or is defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) pxSecondSemaphoreParameters->xSemaphore, "Counting_Sem_2" );
}
}
/* vQueueAddToRegistry() adds the semaphore to the registry, if one is
in use. The registry is provided as a means for kernel aware
debuggers to locate semaphores and has no purpose if a kernel aware debugger
is not being used. The call to vQueueAddToRegistry() will be removed
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
defined to be less than 1. */
vQueueAddToRegistry( ( QueueHandle_t ) pxFirstSemaphoreParameters->xSemaphore, "Counting_Sem_1" );
vQueueAddToRegistry( ( QueueHandle_t ) pxSecondSemaphoreParameters->xSemaphore, "Counting_Sem_2" );
}
/*-----------------------------------------------------------*/
@ -196,14 +205,14 @@ volatile uint32_t *pulSharedVariable, ulExpectedValue;
uint32_t ulCounter;
short sError = pdFALSE, sCheckVariableToUse;
/* See which check variable to use. sNextCheckVariable is not semaphore
/* See which check variable to use. sNextCheckVariable is not semaphore
protected! */
portENTER_CRITICAL();
sCheckVariableToUse = sNextCheckVariable;
sNextCheckVariable++;
portEXIT_CRITICAL();
/* A structure is passed in as the parameter. This contains the shared
/* A structure is passed in as the parameter. This contains the shared
variable being guarded. */
pxParameters = ( xSemaphoreParameters * ) pvParameters;
pulSharedVariable = pxParameters->pulSharedVariable;
@ -231,7 +240,7 @@ short sError = pdFALSE, sCheckVariableToUse;
{
sError = pdTRUE;
}
/* Clear the variable, then count it back up to the expected value
before releasing the semaphore. Would expect a context switch or
two during this time. */

View file

@ -0,0 +1,170 @@
/*
FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. See
* http://www.freertos.org/a00110.html
*----------------------------------------------------------*/
/* Setting configSUPPORT_STATIC_ALLOCATION to 1 allows RTOS objects to be
created using only application supplied memory. No dynamic memory allocation
will be performed. */
#define configSUPPORT_STATIC_ALLOCATION 1
/* Setting configSUPPORT_DYNAMIC_ALLOCATION to 0 results in all calls to
pvPortMalloc() returning NULL, and all calls to vPortFree() being ignored.
Therefore the application can be built without providing an implementation of
either of these functions (so none of the normal heap_n.c files described on
http://www.freertos.org/a00111.html are required). Note that
configTOTAL_HEAP_SIZE is not defined. */
#define configSUPPORT_DYNAMIC_ALLOCATION 0
/* Other constants as described on http://www.freertos.org/a00110.html */
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configUSE_DAEMON_TASK_STARTUP_HOOK 0
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1
#define configCHECK_FOR_STACK_OVERFLOW 0
#define configUSE_RECURSIVE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 20
#define configUSE_MALLOC_FAILED_HOOK 0 /* pvPortMalloc() is not used. */
#define configUSE_APPLICATION_TASK_TAG 1
#define configUSE_COUNTING_SEMAPHORES 1
#define configUSE_ALTERNATIVE_API 0
#define configUSE_QUEUE_SETS 1
#define configUSE_TASK_NOTIFICATIONS 1
/* Software timer related configuration options. */
#define configUSE_TIMERS 1
#define configTIMER_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
#define configTIMER_QUEUE_LENGTH 20
#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )
#define configMAX_PRIORITIES ( 7 )
/* Run time stats gathering configuration options. */
#define configGENERATE_RUN_TIME_STATS 0
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
#define portGET_RUN_TIME_COUNTER_VALUE()
/* Co-routine related configuration options. */
#define configUSE_CO_ROUTINES 0
/* This demo makes use of one or more example stats formatting functions. These
format the raw data provided by the uxTaskGetSystemState() function in to human
readable ASCII form. See the notes in the implementation of vTaskList() within
FreeRTOS/Source/tasks.c for limitations. */
#define configUSE_STATS_FORMATTING_FUNCTIONS 0
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. In most cases the linker will remove unused
functions anyway. */
#define INCLUDE_vTaskPrioritySet 1
#define INCLUDE_uxTaskPriorityGet 1
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 1
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#define INCLUDE_uxTaskGetStackHighWaterMark 1
#define INCLUDE_xTaskGetSchedulerState 1
#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1
#define INCLUDE_xTaskGetIdleTaskHandle 1
#define INCLUDE_pcTaskGetTaskName 1
#define INCLUDE_xTaskGetTaskHandle 1
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xSemaphoreGetMutexHolder 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_xTaskAbortDelay 1
/* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. */
extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Optimised|Win32 = Optimised|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Optimised|Win32.ActiveCfg = Optimised|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Optimised|Win32.Build.0 = Optimised|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.ActiveCfg = Release|Win32
{C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View file

@ -0,0 +1,246 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Optimised|Win32">
<Configuration>Optimised</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C686325E-3261-42F7-AEB1-DDE5280E1CEB}</ProjectGuid>
<ProjectName>RTOSDemo</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">.\Debug\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">.\Debug\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-Trace\Include;.\Trace_Recorder_Configuration;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<AdditionalOptions>/wd4210 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">
<Midl>
<TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-Trace\Include;.\Trace_Recorder_Configuration;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
<ObjectFileName>.\Debug/</ObjectFileName>
<ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<AdditionalOptions>/wd4210 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Debug/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Debug/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Midl>
<TypeLibraryName>.\Release/WIN32.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeaderOutputFile>.\Release/WIN32.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\Release/</AssemblerListingLocation>
<ObjectFileName>.\Release/</ObjectFileName>
<ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
<WarningLevel>Level3</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalIncludeDirectories>..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0c09</Culture>
</ResourceCompile>
<Link>
<OutputFile>.\Release/RTOSDemo.exe</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<ProgramDatabaseFile>.\Release/WIN32.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
<Bscmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>.\Release/WIN32.bsc</OutputFile>
</Bscmake>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\Source\event_groups.c" />
<ClCompile Include="..\..\Source\timers.c" />
<ClCompile Include="..\Common\Minimal\StaticAllocation.c" />
<ClCompile Include="main.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\Source\list.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\Source\portable\MSVC-MingW\port.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\Source\queue.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\Source\tasks.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\include\event_groups.h" />
<ClInclude Include="..\..\Source\include\timers.h" />
<ClInclude Include="..\..\Source\portable\MSVC-MingW\portmacro.h" />
<ClInclude Include="FreeRTOSConfig.h" />
<ClInclude Include="..\..\Source\include\croutine.h" />
<ClInclude Include="..\..\Source\include\FreeRTOS.h" />
<ClInclude Include="..\..\Source\include\list.h" />
<ClInclude Include="..\..\Source\include\portable.h" />
<ClInclude Include="..\..\Source\include\projdefs.h" />
<ClInclude Include="..\..\Source\include\queue.h" />
<ClInclude Include="..\..\Source\include\semphr.h" />
<ClInclude Include="..\..\Source\include\task.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{38712199-cebf-4124-bf15-398f7c3419ea}</UniqueIdentifier>
<Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
</Filter>
<Filter Include="FreeRTOS Source">
<UniqueIdentifier>{af3445a1-4908-4170-89ed-39345d90d30c}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS Source\Source">
<UniqueIdentifier>{f32be356-4763-4cae-9020-974a2638cb08}</UniqueIdentifier>
<Extensions>*.c</Extensions>
</Filter>
<Filter Include="FreeRTOS Source\Include">
<UniqueIdentifier>{a60060e3-3949-4f60-b025-cb84164ae9ed}</UniqueIdentifier>
</Filter>
<Filter Include="FreeRTOS Source\Source\Portable">
<UniqueIdentifier>{88f409e6-d396-4ac5-94bd-7a99c914be46}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\Source\list.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\queue.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\tasks.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS Source\Source\Portable</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\timers.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
<ClCompile Include="..\..\Source\event_groups.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
<ClCompile Include="main.c" />
<ClCompile Include="..\Common\Minimal\StaticAllocation.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\Source\include\croutine.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\FreeRTOS.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\list.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\portable.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\projdefs.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\queue.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\semphr.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\task.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\portable\MSVC-MingW\portmacro.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\timers.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="..\..\Source\include\event_groups.h">
<Filter>FreeRTOS Source\Include</Filter>
</ClInclude>
<ClInclude Include="FreeRTOSConfig.h" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,275 @@
/*
FreeRTOS V9.0.0rc1 - Copyright (C) 2016 Real Time Engineers Ltd.
All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
***************************************************************************
>>! NOTE: The modification to the GPL is included to allow you to !<<
>>! distribute a combined work that includes FreeRTOS without being !<<
>>! obliged to provide the source code for proprietary components !<<
>>! outside of the FreeRTOS kernel. !<<
***************************************************************************
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. Full license text is available on the following
link: http://www.freertos.org/a00114.html
***************************************************************************
* *
* FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross *
* platform software that is more than just the market leader, it *
* is the industry's de facto standard. *
* *
* Help yourself get started quickly while simultaneously helping *
* to support the FreeRTOS project by purchasing a FreeRTOS *
* tutorial book, reference manual, or both: *
* http://www.FreeRTOS.org/Documentation *
* *
***************************************************************************
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
the FAQ page "My application does not run, what could be wrong?". Have you
defined configASSERT()?
http://www.FreeRTOS.org/support - In return for receiving this top quality
embedded software for free we request you assist our global community by
participating in the support forum.
http://www.FreeRTOS.org/training - Investing in training allows your team to
be as productive as possible as early as possible. Now you can receive
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
Ltd, and the world's leading authority on the world's leading RTOS.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
compatible FAT file system, and our tiny thread aware UDP/IP stack.
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
licenses offer ticketed support, indemnification and commercial middleware.
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
engineered and independently SIL3 certified version for use in safety and
mission critical applications that require provable dependability.
1 tab == 4 spaces!
*/
/******************************************************************************
*
* This project is provided as an example of how to create a FreeRTOS project
* that does not need a heap. configSUPPORT_STATIC_ALLOCATION is set to 1 to
* allow RTOS objects to be created using statically allocated RAM, and
* configSUPPORT_DYNAMIC_ALLOCATION is set to 0 to remove any build dependency
* on the FreeRTOS heap. When configSUPPORT_DYNAMIC_ALLOCATION is set to 0
* pvPortMalloc() just equates to NULL, and calls to vPortFree() have no
* effect. See:
*
* http://www.freertos.org/a00111.html and
* http://www.freertos.org/Static_Vs_Dynamic_Memory_Allocation.html
*
*******************************************************************************
*/
/* Standard includes. */
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
/* FreeRTOS kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
/* Standard demo includes. */
#include "StaticAllocation.h"
/*-----------------------------------------------------------*/
/*
* Prototypes for the standard FreeRTOS stack overflow hook (callback)
* function. http://www.freertos.org/Stacks-and-stack-overflow-checking.html
*/
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );
/*
* This demo has configSUPPORT_STATIC_ALLOCATION set to 1 so the following
* application callback function must be provided to supply the RAM that will
* get used for the Idle task data structures and stack.
*/
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize );
/*
* This demo has configSUPPORT_STATIC_ALLOCATION set to 1 and configUSE_TIMERS
* set to 1 so the following application callback function must be provided to
* supply the RAM that will get used for the Timer task data structures and
* stack.
*/
void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize );
/* This demo only uses the standard demo tasks that use statically allocated
RAM. A 'check' task is also created to periodically inspect the demo tasks to
ensure they are still running, and that no errors have been detected. */
static void prvStartCheckTask( void );
static void prvCheckTask( void *pvParameters );
/*-----------------------------------------------------------*/
int main( void )
{
/* This demo has configSUPPORT_STATIC_ALLOCATION set to 1 and
configSUPPORT_DYNAMIC_ALLOCATION set to 0, so the only standard temo tasks
created are the ones that only use static allocation. This allow the
application to be built without including a FreeRTOS heap file (without one
of the heap files described on http://www.freertos.org/a00111.html */
vStartStaticallyAllocatedTasks();
/* Start a task that periodically inspects the tasks created by
vStartStaticallyAllocatedTasks() to ensure they are still running, and not
reporting any errors. */
prvStartCheckTask();
/* Start the scheduler so the demo tasks start to execute. */
vTaskStartScheduler();
/* vTaskStartScheduler() would only return if RAM required by the Idle and
Timer tasks could not be allocated. As this demo uses statically allocated
RAM only, there are no allocations that could fail, and
vTaskStartScheduler() cannot return - so there is no need to put the normal
infinite loop after the call to vTaskStartScheduler(). */
return 0;
}
/*-----------------------------------------------------------*/
static void prvStartCheckTask( void )
{
/* Allocate the data structure that will hold the task's TCB. NOTE: This is
declared static so it still exists after this function has returned. */
static StaticTask_t xCheckTask;
/* Allocate the stack that will be used by the task. NOTE: This is declared
static so it still exists after this function has returned. */
static StackType_t ucTaskStack[ configMINIMAL_STACK_SIZE * sizeof( StackType_t ) ];
/* Create the task, which will use the RAM allocated by the linker to the
variables declared in this function. */
xTaskCreateStatic( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, configMAX_PRIORITIES - 1, NULL, ucTaskStack, &xCheckTask );
}
/*-----------------------------------------------------------*/
static void prvCheckTask( void *pvParameters )
{
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
static char *pcStatusMessage = "No errors";
/* Just to remove compiler warning. */
( void ) pvParameters;
for( ;; )
{
/* Place this task in the blocked state until it is time to run again. */
vTaskDelay( xCycleFrequency );
/* Check the tasks that use static allocation are still executing. */
if( xAreStaticAllocationTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Static allocation";
}
/* This is the only task that uses stdout so its ok to call printf()
directly. */
printf( "%s - tick count %d - number of tasks executing %d\r\n",
pcStatusMessage,
xTaskGetTickCount(),
uxTaskGetNumberOfTasks() );
}
}
/*-----------------------------------------------------------*/
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
{
( void ) pcTaskName;
( void ) pxTask;
/* Run time stack overflow checking is performed if
configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook
function is called if a stack overflow is detected. This function is
provided as an example only as stack overflow checking does not function
when running the FreeRTOS Windows port. */
vAssertCalled( __LINE__, __FILE__ );
}
/*-----------------------------------------------------------*/
void vAssertCalled( unsigned long ulLine, const char * const pcFileName )
{
volatile uint32_t ulSetToNonZeroInDebuggerToContinue = 0;
/* Called if an assertion passed to configASSERT() fails. See
http://www.freertos.org/a00110.html#configASSERT for more information. */
/* Parameters are not used. */
( void ) ulLine;
( void ) pcFileName;
printf( "ASSERT! Line %d, file %s\r\n", ulLine, pcFileName );
taskENTER_CRITICAL();
{
/* You can step out of this function to debug the assertion by using
the debugger to set ulSetToNonZeroInDebuggerToContinue to a non-zero
value. */
while( ulSetToNonZeroInDebuggerToContinue == 0 )
{
__asm{ NOP };
__asm{ NOP };
}
}
taskEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint16_t *pusIdleTaskStackSize )
{
/* The buffers used by the idle task must be static so they are persistent, and
so exist after this function returns. */
static StaticTask_t xIdleTaskTCB;
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/* configSUPORT_STATIC_ALLOCATION is set to 1 and
configSUPPORT_DYNAMIC_ALLOCATION is 0, so the application must supply the
buffers that will be used to hold the Idle task data structure and stack. */
*ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
*ppxIdleTaskStackBuffer = uxIdleTaskStack;
*pusIdleTaskStackSize = configMINIMAL_STACK_SIZE; /* In words. NOT in bytes! */
}
/*-----------------------------------------------------------*/
void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint16_t *pusTimerTaskStackSize )
{
/* The buffers used by the Timer/Daemon task must be static so they are
persistent, and so exist after this function returns. */
static StaticTask_t xTimerTaskTCB;
static StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
/* configSUPPORT_STATIC_ALLOCATION is set to 1,
configSUPPORT_DYNAMIC_ALLOCATION is set to 1, and configUSE_TIMERS is set
to 1, so the application must supply the buffers that will be used to hold
the Timer task data structure and stack. */
*ppxTimerTaskTCBBuffer = &xTimerTaskTCB;
*ppxTimerTaskStackBuffer = uxTimerTaskStack;
*pusTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH; /* In words. NOT in bytes! */
}

View file

@ -697,6 +697,10 @@ static void prvPermanentlyBlockingSemaphoreTask( void *pvParameters )
{
SemaphoreHandle_t xSemaphore;
/* Prevent compiler warning about unused parameter in the case that
configASSERT() is not defined. */
( void ) pvParameters;
/* This task should block on a semaphore, and never return. */
xSemaphore = xSemaphoreCreateBinary();
configASSERT( xSemaphore );
@ -712,6 +716,10 @@ SemaphoreHandle_t xSemaphore;
static void prvPermanentlyBlockingNotificationTask( void *pvParameters )
{
/* Prevent compiler warning about unused parameter in the case that
configASSERT() is not defined. */
( void ) pvParameters;
/* This task should block on a task notification, and never return. */
ulTaskNotifyTake( pdTRUE, portMAX_DELAY );

View file

@ -56,7 +56,7 @@
</matcher>
</filter>
<filter>
<id>1418321193247</id>
<id>1458581605399</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -65,7 +65,7 @@
</matcher>
</filter>
<filter>
<id>1418321193247</id>
<id>1458581605404</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -74,7 +74,7 @@
</matcher>
</filter>
<filter>
<id>1418321193257</id>
<id>1458581605410</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -83,7 +83,7 @@
</matcher>
</filter>
<filter>
<id>1418321193257</id>
<id>1458581605415</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -92,7 +92,7 @@
</matcher>
</filter>
<filter>
<id>1418321193267</id>
<id>1458581605421</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -101,7 +101,7 @@
</matcher>
</filter>
<filter>
<id>1418321193277</id>
<id>1458581605427</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -110,7 +110,7 @@
</matcher>
</filter>
<filter>
<id>1418321193277</id>
<id>1458581605434</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -119,7 +119,7 @@
</matcher>
</filter>
<filter>
<id>1418321193287</id>
<id>1458581605441</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -128,7 +128,7 @@
</matcher>
</filter>
<filter>
<id>1418321193297</id>
<id>1458581605450</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -137,7 +137,7 @@
</matcher>
</filter>
<filter>
<id>1418321193297</id>
<id>1458581605458</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -146,7 +146,7 @@
</matcher>
</filter>
<filter>
<id>1418321193308</id>
<id>1458581605463</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -155,7 +155,7 @@
</matcher>
</filter>
<filter>
<id>1418321193313</id>
<id>1458581605473</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -164,7 +164,7 @@
</matcher>
</filter>
<filter>
<id>1418321193319</id>
<id>1458581605490</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -173,7 +173,7 @@
</matcher>
</filter>
<filter>
<id>1418321193325</id>
<id>1458581605514</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -182,7 +182,7 @@
</matcher>
</filter>
<filter>
<id>1418321193349</id>
<id>1458581605524</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -191,7 +191,7 @@
</matcher>
</filter>
<filter>
<id>1418321193369</id>
<id>1458581605530</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -200,7 +200,7 @@
</matcher>
</filter>
<filter>
<id>1418321193379</id>
<id>1458581605535</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
@ -208,6 +208,24 @@
<arguments>1.0-name-matches-false-false-TaskNotify.c</arguments>
</matcher>
</filter>
<filter>
<id>1458581605540</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-QueueSetPolling.c</arguments>
</matcher>
</filter>
<filter>
<id>1458581605547</id>
<name>Standard_Demo_Tasks</name>
<type>5</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-AbortDelay.c</arguments>
</matcher>
</filter>
<filter>
<id>0</id>
<name>FreeRTOS_Source/portable</name>

View file

@ -4,6 +4,10 @@ org.eclipse.cdt.codan.checkers.errnoreturn=-Warning
org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
org.eclipse.cdt.codan.checkers.errreturnvalue=-Error
org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.checkers.nocommentinside=-Error
org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.checkers.nolinecomment=-Error
org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true}}
org.eclipse.cdt.codan.checkers.noreturn=-Error
org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},implicit\=>false}
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error

View file

@ -78,7 +78,8 @@
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. See
* http://www.freertos.org/a00110.html
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
@ -87,7 +88,7 @@
#define configUSE_TICK_HOOK 1
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 23 * 1024 ) )
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 35 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
@ -146,6 +147,8 @@ functions anyway. */
#define INCLUDE_eTaskGetState 1
#define INCLUDE_xSemaphoreGetMutexHolder 1
#define INCLUDE_xTimerPendFunctionCall 1
#define INCLUDE_xTaskAbortDelay 1
#define INCLUDE_xTaskGetTaskHandle 1
/* It is a good idea to define configASSERT() while developing. configASSERT()
uses the same semantics as the standard C assert() macro. */

View file

@ -116,9 +116,9 @@ that make up the total heap. This is only done to provide an example of heap_5
being used as this demo could easily create one large heap region instead of
multiple smaller heap regions - in which case heap_4.c would be the more
appropriate choice. */
#define mainREGION_1_SIZE 3001
#define mainREGION_1_SIZE 7001
#define mainREGION_2_SIZE 18105
#define mainREGION_3_SIZE 1107
#define mainREGION_3_SIZE 2807
/*
* main_blinky() is used when mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.

View file

@ -139,6 +139,9 @@
#include "EventGroupsDemo.h"
#include "IntSemTest.h"
#include "TaskNotify.h"
#include "QueueSetPolling.h"
#include "blocktim.h"
#include "AbortDelay.h"
/* Priorities at which the tasks are created. */
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )
@ -217,6 +220,9 @@ int main_full( void )
xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
vStartEventGroupTasks();
vStartInterruptSemaphoreTasks();
vStartQueueSetPollingTask();
vCreateBlockTimeTasks();
vCreateAbortDelayTasks();
#if( configUSE_PREEMPTION != 0 )
{
@ -238,16 +244,16 @@ int main_full( void )
/* Start the scheduler itself. */
vTaskStartScheduler();
/* Should never get here unless there was not enough heap space to create
/* Should never get here unless there was not enough heap space to create
the idle and other system tasks. */
return 0;
return 0;
}
/*-----------------------------------------------------------*/
static void prvCheckTask( void *pvParameters )
{
TickType_t xNextWakeTime;
const TickType_t xCycleFrequency = 2500 / portTICK_PERIOD_MS;
const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
/* Just to remove compiler warning. */
( void ) pvParameters;
@ -336,6 +342,18 @@ const TickType_t xCycleFrequency = 2500 / portTICK_PERIOD_MS;
{
pcStatusMessage = "Error: Queue overwrite";
}
else if( xAreQueueSetPollTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Queue set polling";
}
else if( xAreBlockTimeTestTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Block time";
}
else if( xAreAbortDelayTestTasksStillRunning() != pdPASS )
{
pcStatusMessage = "Error: Abort delay";
}
/* This is the only task that uses stdout so its ok to call printf()
directly. */
@ -416,6 +434,7 @@ void vFullDemoTickHookFunction( void )
/* Write to a queue that is in use as part of the queue set demo to
demonstrate using queue sets from an ISR. */
vQueueSetAccessQueueSetFromISR();
vQueueSetPollingInterruptAccess();
/* Exercise event groups from interrupts. */
vPeriodicEventGroupsProcessing();