]> git.sur5r.net Git - freertos/commitdiff
Update to allow use with the cooperative scheduler.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 27 Jan 2008 20:25:36 +0000 (20:25 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sun, 27 Jan 2008 20:25:36 +0000 (20:25 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@147 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/Common/Full/dynamic.c
Demo/Common/Full/events.c
Demo/Common/Minimal/AltBlock.c
Demo/Common/Minimal/blocktim.c
Demo/Common/Minimal/countsem.c

index 3503f714caec4b589a05d18dedeb5334072c3f7f..9150cad1ddd56272242c0b16f51868b209284a11 100644 (file)
@@ -251,6 +251,10 @@ unsigned portBASE_TYPE uxOurPriority;
                vTaskPrioritySet( NULL, uxOurPriority + 1 );\r
                        ( *pulCounter )++;              \r
                vTaskPrioritySet( NULL, uxOurPriority );\r
+\r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -342,6 +346,10 @@ const portCHAR * const pcTaskFailMsg = "Priority manipulation Task Failed\r\n";
                        portEXIT_CRITICAL();\r
                }\r
 \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
+\r
                /* Resume the continuous count task and do it all again. */\r
                vTaskResume( xContinuousIncrementHandle );\r
        }\r
@@ -421,6 +429,10 @@ portBASE_TYPE xGotValue;
                        }\r
                        xTaskResumeAll();\r
 \r
+                       #if configUSE_PREEMPTION == 0\r
+                               taskYIELD();\r
+                       #endif\r
+\r
                } while( xGotValue == pdFALSE );\r
 \r
                if( ulReceivedValue != ulExpectedValue )\r
index bbc1e1f57f3503e036193340d523c6c69c508e56..fe1fae12d8ee0beb8e3919594feb47e19168ad54 100644 (file)
@@ -241,7 +241,9 @@ portBASE_TYPE xDummy = 0;
                xTaskResumeAll();\r
                prvCheckTaskCounters( evtLOWEST_PRIORITY_INDEX, 1 );\r
                \r
-               \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif          \r
                \r
                /* Do the same basic test another few times - selectively suspending\r
                and resuming tasks and each time calling prvCheckTaskCounters() passing\r
@@ -267,7 +269,9 @@ portBASE_TYPE xDummy = 0;
                prvCheckTaskCounters( evtHIGHEST_PRIORITY_INDEX_1, 1 );\r
 \r
 \r
-\r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
 \r
 \r
                /* Now a slight change, first suspend all tasks. */\r
@@ -310,6 +314,10 @@ portBASE_TYPE xDummy = 0;
                        }\r
                }\r
                xTaskResumeAll();\r
+\r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
                \r
                /* We should have been preempted by resuming the scheduler - so by the\r
                time we are running again we expect the high priority task to have \r
index f5d59553a6793dbdb326ee0b71c71f9f1058f737..3990ec7b4ccd7a57e7fd8d78183633a97f92e21b 100644 (file)
@@ -157,6 +157,12 @@ portTickType xTimeToBlock, xBlockedTime;
                        }\r
                }\r
 \r
+\r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
+\r
+\r
                /*********************************************************************\r
         Test 2\r
 \r
@@ -208,6 +214,10 @@ portTickType xTimeToBlock, xBlockedTime;
                        }\r
                }\r
 \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
+\r
                \r
                /*********************************************************************\r
         Test 3\r
@@ -283,6 +293,9 @@ portTickType xTimeToBlock, xBlockedTime;
                vTaskDelay( bktSHORT_WAIT );\r
                xRunIndicator = 0;\r
 \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
 \r
                /*********************************************************************\r
         Test 4\r
index 523f5a9bfc4eafa02931832bec3a1949c78aee98..4f0f05bf0123bcd99874e4bb337556a0072f28d2 100644 (file)
@@ -146,6 +146,10 @@ portTickType xTimeToBlock, xBlockedTime;
                        }\r
                }\r
 \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
+\r
                /*********************************************************************\r
         Test 2\r
 \r
@@ -197,6 +201,9 @@ portTickType xTimeToBlock, xBlockedTime;
                        }\r
                }\r
 \r
+               #if configUSE_PREEMPTION == 0\r
+                       taskYIELD();\r
+               #endif\r
                \r
                /*********************************************************************\r
         Test 3\r
index 288e2228985e4c23be48c9ce0cf689ab56bdf9fb..3d55776ea7b77f844fef5efd542a962a7f200d7b 100644 (file)
@@ -159,6 +159,10 @@ unsigned portBASE_TYPE ux;
                ( *puxLoopCounter )++;\r
        }\r
 \r
+       #if configUSE_PREEMPTION == 0\r
+               taskYIELD();\r
+       #endif\r
+\r
        /* If the semaphore count is zero then we should not be able to 'take' \r
        the semaphore. */\r
        if( xSemaphoreTake( xSemaphore, countDONT_BLOCK ) == pdPASS )\r
@@ -191,6 +195,10 @@ unsigned portBASE_TYPE ux;
                ( *puxLoopCounter )++;\r
        }\r
 \r
+       #if configUSE_PREEMPTION == 0\r
+               taskYIELD();\r
+       #endif\r
+\r
        /* If the semaphore count is at its maximum then we should not be able to\r
        'give' the semaphore. */\r
        if( xSemaphoreGive( xSemaphore ) == pdPASS )\r