mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-23 03:28:37 -04:00
Kernel code:
+ Added mtCOVERAGE_TEST_DELAY() macro to facilitate getting better code coverage during testing. + Update prvNotifyQueueSetContainer() so it does not call xTaskRemoveFromEventList() if it is called from an interrupt, and the queue is locked. Demo apps: Added QueueSetPolling.c/h demo/test functions.
This commit is contained in:
parent
7d169cef52
commit
96e72413f7
12 changed files with 362 additions and 20 deletions
|
@ -395,6 +395,7 @@ static void prvQueueSetReceivingTask( void *pvParameters )
|
|||
{
|
||||
uint32_t ulReceived;
|
||||
QueueHandle_t xActivatedQueue;
|
||||
TickType_t xBlockTime;
|
||||
|
||||
/* Remove compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
@ -405,14 +406,28 @@ QueueHandle_t xActivatedQueue;
|
|||
|
||||
for( ;; )
|
||||
{
|
||||
/* For test coverage reasons, the block time is dependent on the
|
||||
priority of this task - which changes during the test. When the task
|
||||
is at the idle priority it polls the queue set. */
|
||||
if( uxTaskPriorityGet( NULL ) == tskIDLE_PRIORITY )
|
||||
{
|
||||
xBlockTime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
xBlockTime = portMAX_DELAY;
|
||||
}
|
||||
|
||||
/* Wait for a message to arrive on one of the queues in the set. */
|
||||
xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );
|
||||
configASSERT( xActivatedQueue );
|
||||
xActivatedQueue = xQueueSelectFromSet( xQueueSet, portMAX_DELAY );
|
||||
|
||||
if( xActivatedQueue == NULL )
|
||||
{
|
||||
/* This should not happen as an infinite delay was used. */
|
||||
xQueueSetTasksStatus = pdFAIL;
|
||||
if( xBlockTime != 0 )
|
||||
{
|
||||
/* This should not happen as an infinite delay was used. */
|
||||
xQueueSetTasksStatus = pdFAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -432,11 +447,11 @@ QueueHandle_t xActivatedQueue;
|
|||
prvCheckReceivedValue( ulReceived );
|
||||
}
|
||||
taskEXIT_CRITICAL();
|
||||
}
|
||||
|
||||
if( xQueueSetTasksStatus == pdPASS )
|
||||
{
|
||||
ulCycleCounter++;
|
||||
if( xQueueSetTasksStatus == pdPASS )
|
||||
{
|
||||
ulCycleCounter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -604,8 +619,7 @@ static BaseType_t xQueueToWriteTo = 0;
|
|||
{
|
||||
ulISRTxValue++;
|
||||
|
||||
/* If the Tx value has wrapped then set it back to its
|
||||
initial value. */
|
||||
/* If the Tx value has wrapped then set it back to its initial value. */
|
||||
if( ulISRTxValue == 0UL )
|
||||
{
|
||||
ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue