Final V8.2.1 release ready for tagging:

+ Added MSP432 (ARM Cortex-M4F MSP430!) demos for IAR, Keil and CCS.
+ Renamed directory containing demo for STM32F7 ARM Cortex-M7.
+ Renamed directory containing demo for SAMV71 ARM Cortex-M7.
+ Introduced xTaskNotifyAndQuery().
This commit is contained in:
Richard Barry 2015-03-24 15:24:49 +00:00
parent 693d0520bc
commit 8dadb6b87c
647 changed files with 67785 additions and 977 deletions

View file

@ -147,7 +147,7 @@ static void prvSingleTaskTests( void )
{
const TickType_t xTicksToWait = pdMS_TO_TICKS( 100UL );
BaseType_t xReturned;
uint32_t ulNotifiedValue, ulLoop, ulNotifyingValue;
uint32_t ulNotifiedValue, ulLoop, ulNotifyingValue, ulPreviousValue, ulExpectedValue;
TickType_t xTimeOnEntering;
const uint32_t ulFirstNotifiedConst = 100001UL, ulSecondNotifiedValueConst = 5555UL, ulMaxLoops = 5UL;
const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
@ -172,12 +172,15 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
Check no blocking when notifications are pending. First notify itself -
this would not be a normal thing to do and is done here for test purposes
only. */
xReturned = xTaskNotify( xTaskToNotify, ulFirstNotifiedConst, eSetValueWithoutOverwrite );
xReturned = xTaskNotifyAndQuery( xTaskToNotify, ulFirstNotifiedConst, eSetValueWithoutOverwrite, &ulPreviousValue );
/* Even through the 'without overwrite' action was used the update should
have been successful. */
configASSERT( xReturned == pdPASS );
/* No bits should have been pending previously. */
configASSERT( ulPreviousValue == 0 );
/* The task should now have a notification pending, and so not time out. */
xTimeOnEntering = xTaskGetTickCount();
xReturned = xTaskNotifyWait( ULONG_MAX, 0, &ulNotifiedValue, xTicksToWait );
@ -351,6 +354,28 @@ const uint32_t ulBit0 = 0x01UL, ulBit1 = 0x02UL;
/*--------------------------------------------------------------------------
Now try querying the previus value while notifying a task. */
xTaskNotifyAndQuery( xTaskToNotify, 0x00, eSetBits, &ulPreviousValue );
configASSERT( ulNotifiedValue == ( ULONG_MAX & ~( ulBit0 | ulBit1 ) ) );
/* Clear all bits. */
xTaskNotifyWait( 0x00, ULONG_MAX, &ulNotifiedValue, 0 );
xTaskNotifyAndQuery( xTaskToNotify, 0x00, eSetBits, &ulPreviousValue );
configASSERT( ulPreviousValue == 0 );
ulExpectedValue = 0;
for( ulLoop = 0x01; ulLoop < 0x80UL; ulLoop <<= 1UL )
{
/* Set the next bit up, and expect to receive the last bits set (so
the previous value will not yet have the bit being set this time
around). */
xTaskNotifyAndQuery( xTaskToNotify, ulLoop, eSetBits, &ulPreviousValue );
configASSERT( ulExpectedValue == ulPreviousValue );
ulExpectedValue |= ulLoop;
}
/* Incremented to show the task is still running. */
ulNotifyCycleCount++;