mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
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:
parent
693d0520bc
commit
8dadb6b87c
647 changed files with 67785 additions and 977 deletions
|
@ -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++;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue