summaryrefslogtreecommitdiff
path: root/FreeRTOS/Demo/Common/Minimal
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Demo/Common/Minimal')
-rw-r--r--FreeRTOS/Demo/Common/Minimal/AbortDelay.c57
-rw-r--r--FreeRTOS/Demo/Common/Minimal/GenQTest.c2
-rw-r--r--FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c8
3 files changed, 8 insertions, 59 deletions
diff --git a/FreeRTOS/Demo/Common/Minimal/AbortDelay.c b/FreeRTOS/Demo/Common/Minimal/AbortDelay.c
index 9fc8cfeb0..65d0104e8 100644
--- a/FreeRTOS/Demo/Common/Minimal/AbortDelay.c
+++ b/FreeRTOS/Demo/Common/Minimal/AbortDelay.c
@@ -149,10 +149,6 @@ uint32_t ulTestToPerform = abtNOTIFY_WAIT_ABORTS;
TickType_t xTimeAtStart;
const TickType_t xStartMargin = 2UL;
-/* Used to control whether to use xTaskAbortDelay() or xTaskAbortDelayFromISR() so
-both are used with all the tests. */
-BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;
-
/* Just to remove compiler warnings. */
( void ) pvParameters;
@@ -177,46 +173,10 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;
raise the priority of the controlling task to that of the blocking
task to minimise discrepancies. */
vTaskPrioritySet( NULL, abtBLOCKING_PRIORITY );
-
vTaskDelay( xMaxBlockTime + xHalfMaxBlockTime + xStartMargin );
-
- /* For test coverage sometimes xTaskAbortDelay() is used and sometimes
- xTaskAbortDelayFromISR() is used. */
- if( xUseFromISRVersion == pdFALSE )
+ if( xTaskAbortDelay( xBlockingTask ) != pdPASS )
{
- if( xTaskAbortDelay( xBlockingTask ) != pdPASS )
- {
- xErrorOccurred = pdTRUE;
- }
- }
- else
- {
- xHigherPriorityTaskWoken = pdFALSE;
-
- /* For test coverage, sometimes xHigherPriorityTaskWoken is used, and
- sometimes NULL is used. */
-
- if( ( xControllingCycles % 2 ) == 0 )
- {
- if( xTaskAbortDelayFromISR( xBlockingTask, &xHigherPriorityTaskWoken ) != pdPASS )
- {
- xErrorOccurred = pdTRUE;
- }
- }
- else
- {
- if( xTaskAbortDelayFromISR( xBlockingTask, NULL ) != pdPASS )
- {
- xErrorOccurred = pdTRUE;
- }
- }
-
- /* The tasks have the same priority so xHigherPriorityTaskWoken should
- never get set. */
- if( xHigherPriorityTaskWoken != pdFALSE )
- {
- xErrorOccurred = pdTRUE;
- }
+ xErrorOccurred = pdTRUE;
}
/* Reset the priority to the normal controlling priority. */
@@ -241,13 +201,6 @@ BaseType_t xUseFromISRVersion = pdFALSE, xHigherPriorityTaskWoken;
/* To indicate this task is still executing. */
xControllingCycles++;
-
- if( ( xControllingCycles % abtMAX_TESTS ) == 0 )
- {
- /* Looped through all the tests. Switch between using xTaskAbortDelay()
- and xTaskAbortDelayFromISR() for the next round of tests. */
- xUseFromISRVersion = !xUseFromISRVersion;
- }
}
}
/*-----------------------------------------------------------*/
@@ -335,12 +288,6 @@ BaseType_t xReturned;
{
xErrorOccurred = pdTRUE;
}
-
- xReturned = xTaskAbortDelayFromISR( xThisTask, NULL );
- if( xReturned != pdFALSE )
- {
- xErrorOccurred = pdTRUE;
- }
}
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Demo/Common/Minimal/GenQTest.c b/FreeRTOS/Demo/Common/Minimal/GenQTest.c
index 97f693c85..b9022333f 100644
--- a/FreeRTOS/Demo/Common/Minimal/GenQTest.c
+++ b/FreeRTOS/Demo/Common/Minimal/GenQTest.c
@@ -218,7 +218,7 @@ QueueHandle_t xQueue;
for( ;; )
{
/* The queue is empty, so sending an item to the back of the queue
- should have the same efect as sending it to the front of the queue.
+ should have the same effect as sending it to the front of the queue.
First send to the front and check everything is as expected. */
ulLoopCounterSnapshot = ulLoopCounter;
diff --git a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c
index c5854bc62..3eac259cf 100644
--- a/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c
+++ b/FreeRTOS/Demo/Common/Minimal/StreamBufferDemo.c
@@ -971,8 +971,10 @@ BaseType_t xErrorDetected = pdFALSE;
else if( xTriggerLevel < xReadBlockTime )
{
/* Trigger level was less than the block time so we expect to
- have received the trigger level number of bytes. */
- if( ( xTriggerLevel - xBytesReceived ) > xAllowableMargin )
+ have received the trigger level number of bytes - could be more
+ though depending on other activity between the task being
+ unblocked and the task reading the number of bytes received. */
+ if( ( xBytesReceived - xTriggerLevel ) > xAllowableMargin )
{
xErrorDetected = pdTRUE;
}
@@ -983,7 +985,7 @@ BaseType_t xErrorDetected = pdFALSE;
receive no greater than the block time, but one or two less is
ok due to variations in how far through the time slice the
functions get executed. */
- if( xBytesReceived > xReadBlockTime )
+ if( ( xBytesReceived - xReadBlockTime ) > xAllowableMargin )
{
xErrorDetected = pdTRUE;
}