|
|
|
@ -69,7 +69,7 @@
|
|
|
|
|
#define bktQUEUE_LENGTH ( 5 )
|
|
|
|
|
#define bktSHORT_WAIT ( ( ( portTickType ) 20 ) / portTICK_RATE_MS )
|
|
|
|
|
#define bktPRIMARY_BLOCK_TIME ( 10 )
|
|
|
|
|
#define bktALLOWABLE_MARGIN ( 12 )
|
|
|
|
|
#define bktALLOWABLE_MARGIN ( 15 )
|
|
|
|
|
#define bktTIME_TO_BLOCK ( 175 )
|
|
|
|
|
#define bktDONT_BLOCK ( ( portTickType ) 0 )
|
|
|
|
|
#define bktRUN_INDICATOR ( ( unsigned portBASE_TYPE ) 0x55 )
|
|
|
|
@ -126,10 +126,6 @@ portTickType xTimeToBlock, xBlockedTime;
|
|
|
|
|
time. When we wake, ensure the delta in time is as expected. */
|
|
|
|
|
xTimeToBlock = bktPRIMARY_BLOCK_TIME << xItem;
|
|
|
|
|
|
|
|
|
|
/* A critical section is used to minimise the jitter in the time
|
|
|
|
|
measurements. */
|
|
|
|
|
portENTER_CRITICAL();
|
|
|
|
|
{
|
|
|
|
|
xTimeWhenBlocking = xTaskGetTickCount();
|
|
|
|
|
|
|
|
|
|
/* We should unblock after xTimeToBlock having not received
|
|
|
|
@ -141,8 +137,6 @@ portTickType xTimeToBlock, xBlockedTime;
|
|
|
|
|
|
|
|
|
|
/* How long were we blocked for? */
|
|
|
|
|
xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;
|
|
|
|
|
}
|
|
|
|
|
portEXIT_CRITICAL();
|
|
|
|
|
|
|
|
|
|
if( xBlockedTime < xTimeToBlock )
|
|
|
|
|
{
|
|
|
|
@ -183,8 +177,6 @@ portTickType xTimeToBlock, xBlockedTime;
|
|
|
|
|
time. When we wake, ensure the delta in time is as expected. */
|
|
|
|
|
xTimeToBlock = bktPRIMARY_BLOCK_TIME << xItem;
|
|
|
|
|
|
|
|
|
|
portENTER_CRITICAL();
|
|
|
|
|
{
|
|
|
|
|
xTimeWhenBlocking = xTaskGetTickCount();
|
|
|
|
|
|
|
|
|
|
/* We should unblock after xTimeToBlock having not received
|
|
|
|
@ -196,8 +188,6 @@ portTickType xTimeToBlock, xBlockedTime;
|
|
|
|
|
|
|
|
|
|
/* How long were we blocked for? */
|
|
|
|
|
xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;
|
|
|
|
|
}
|
|
|
|
|
portEXIT_CRITICAL();
|
|
|
|
|
|
|
|
|
|
if( xBlockedTime < xTimeToBlock )
|
|
|
|
|
{
|
|
|
|
@ -388,8 +378,6 @@ portBASE_TYPE xData;
|
|
|
|
|
The first thing we do is attempt to read from the queue. It should be
|
|
|
|
|
full so we block. Note the time before we block so we can check the
|
|
|
|
|
wake time is as per that expected. */
|
|
|
|
|
portENTER_CRITICAL();
|
|
|
|
|
{
|
|
|
|
|
xTimeWhenBlocking = xTaskGetTickCount();
|
|
|
|
|
|
|
|
|
|
/* We should unblock after bktTIME_TO_BLOCK having not received
|
|
|
|
@ -403,8 +391,6 @@ portBASE_TYPE xData;
|
|
|
|
|
|
|
|
|
|
/* How long were we inside the send function? */
|
|
|
|
|
xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;
|
|
|
|
|
}
|
|
|
|
|
portEXIT_CRITICAL();
|
|
|
|
|
|
|
|
|
|
/* We should not have blocked for less time than bktTIME_TO_BLOCK. */
|
|
|
|
|
if( xBlockedTime < bktTIME_TO_BLOCK )
|
|
|
|
@ -428,8 +414,6 @@ portBASE_TYPE xData;
|
|
|
|
|
Test 4
|
|
|
|
|
|
|
|
|
|
As per test three, but with the send and receive reversed. */
|
|
|
|
|
portENTER_CRITICAL();
|
|
|
|
|
{
|
|
|
|
|
xTimeWhenBlocking = xTaskGetTickCount();
|
|
|
|
|
|
|
|
|
|
/* We should unblock after bktTIME_TO_BLOCK having not received
|
|
|
|
@ -441,8 +425,6 @@ portBASE_TYPE xData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;
|
|
|
|
|
}
|
|
|
|
|
portEXIT_CRITICAL();
|
|
|
|
|
|
|
|
|
|
/* We should not have blocked for less time than bktTIME_TO_BLOCK. */
|
|
|
|
|
if( xBlockedTime < bktTIME_TO_BLOCK )
|
|
|
|
|