]> git.sur5r.net Git - freertos/commitdiff
Prepare for a FreeRTOS V9 release candidate:
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 18 Feb 2016 10:07:42 +0000 (10:07 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 18 Feb 2016 10:07:42 +0000 (10:07 +0000)
- Remove the standard demo files that used the [long since deprecated] alternative API.
- Add standard demo task that tests the new xTaskAbortDelay() function.
- Update the Win32 Visual Studio project to use Visual Studio 2015 Community Edition.
- Rename the xGenericListItem TCB member to xStateListItem as it better describes the member's purpose.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2417 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

59 files changed:
FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcBase.c
FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/FreeRTOSConfig.h
FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/Full_Demo/main_full.c
FreeRTOS/Demo/CORTEX_A9_Zynq_ZC702/RTOSDemo/src/main.c
FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h
FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil/FreeRTOSConfig.h
FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil/Keil_Specific/RTOSDemo.uvoptx
FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil/main_full/main_full.c
FreeRTOS/Demo/CORTEX_M4F_CEC1302_Keil/main_low_power/main_low_power.c
FreeRTOS/Demo/Common/Minimal/AbortDelay.c [new file with mode: 0644]
FreeRTOS/Demo/Common/Minimal/AltBlckQ.c [deleted file]
FreeRTOS/Demo/Common/Minimal/AltBlock.c [deleted file]
FreeRTOS/Demo/Common/Minimal/AltPollQ.c [deleted file]
FreeRTOS/Demo/Common/Minimal/AltQTest.c [deleted file]
FreeRTOS/Demo/Common/Minimal/blocktim.c
FreeRTOS/Demo/Common/Minimal/readme.txt [new file with mode: 0644]
FreeRTOS/Demo/Common/include/AbortDelay.h [new file with mode: 0644]
FreeRTOS/Demo/Common/include/AltBlckQ.h [deleted file]
FreeRTOS/Demo/Common/include/AltBlock.h [deleted file]
FreeRTOS/Demo/Common/include/AltPollQ.h [deleted file]
FreeRTOS/Demo/Common/include/AltQTest.h [deleted file]
FreeRTOS/Demo/WIN32-MSVC-lwIP/FreeRTOSConfig.h
FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h
FreeRTOS/Demo/WIN32-MSVC/Trace_Recorder_Configuration/trcConfig.h
FreeRTOS/Demo/WIN32-MSVC/WIN32.sln
FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj
FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters
FreeRTOS/Demo/WIN32-MSVC/main.c
FreeRTOS/Demo/WIN32-MSVC/main_full.c
FreeRTOS/Demo/WIN32-MingW/FreeRTOSConfig.h
FreeRTOS/Source/event_groups.c
FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/include/event_groups.h
FreeRTOS/Source/include/mpu_wrappers.h
FreeRTOS/Source/include/queue.h
FreeRTOS/Source/include/semphr.h
FreeRTOS/Source/include/task.h
FreeRTOS/Source/portable/CCS/ARM_CM4F/port.c
FreeRTOS/Source/portable/GCC/ARM_CA9/portmacro.h
FreeRTOS/Source/portable/GCC/ARM_CM3/port.c
FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h
FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c
FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h
FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/port.c
FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1/portmacro.h
FreeRTOS/Source/portable/GCC/IA32_flat/port.c
FreeRTOS/Source/portable/GCC/MicroBlazeV8/portmacro.h
FreeRTOS/Source/portable/IAR/ARM_CM3/port.c
FreeRTOS/Source/portable/IAR/ARM_CM3/portmacro.h
FreeRTOS/Source/portable/IAR/ARM_CM4F/port.c
FreeRTOS/Source/portable/IAR/ARM_CM4F/portmacro.h
FreeRTOS/Source/portable/IAR/ARM_CM7/r0p1/port.c
FreeRTOS/Source/portable/MPLAB/PIC32MZ/port.c
FreeRTOS/Source/portable/MSVC-MingW/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
FreeRTOS/Source/portable/RVDS/ARM_CM7/r0p1/port.c
FreeRTOS/Source/queue.c
FreeRTOS/Source/tasks.c

index 7ffa8161109a76693896d4a1de4986edb842464c..47f025854727330adc64257e1324c6d8f182c9ac 100644 (file)
@@ -48,7 +48,7 @@
  ******************************************************************************/\r
 \r
 /* Tasks and kernel objects can be explicitly excluded from the trace to reduce\r
-buffer usage. This structure handles the exclude flags for all objects and tasks. \r
+buffer usage. This structure handles the exclude flags for all objects and tasks.\r
 Note that slot 0 is not used, since not a valid handle. */\r
 uint8_t excludedObjects[(TRACE_KERNEL_OBJECT_COUNT + TRACE_NCLASSES) / 8 + 1] = { 0 };\r
 \r
@@ -58,43 +58,43 @@ This structure handle the exclude flags for all event codes */
 uint8_t excludedEventCodes[NEventCodes / 8 + 1] = { 0 };\r
 \r
 /* A set of stacks that keeps track of available object handles for each class.\r
-The stacks are empty initially, meaning that allocation of new handles will be \r
+The stacks are empty initially, meaning that allocation of new handles will be\r
 based on a counter (for each object class). Any delete operation will\r
 return the handle to the corresponding stack, for reuse on the next allocate.*/\r
 objectHandleStackType objectHandleStacks = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 } };\r
 \r
-/* Initial HWTC_COUNT value, for detecting if the time-stamping source is \r
-enabled. If using the OS periodic timer for time-stamping, this might not \r
+/* Initial HWTC_COUNT value, for detecting if the time-stamping source is\r
+enabled. If using the OS periodic timer for time-stamping, this might not\r
 have been configured on the earliest events during the startup. */\r
 uint32_t init_hwtc_count;\r
 \r
 /*******************************************************************************\r
  * RecorderData\r
  *\r
- * The main data structure. This is the data read by the Tracealyzer tools, \r
- * typically through a debugger RAM dump. The recorder uses the pointer \r
+ * The main data structure. This is the data read by the Tracealyzer tools,\r
+ * typically through a debugger RAM dump. The recorder uses the pointer\r
  * RecorderDataPtr for accessing this, to allow for dynamic allocation.\r
  *\r
  * On the NXP LPC17xx you may use the secondary RAM bank (AHB RAM) for this\r
  * purpose. For instance, the LPC1766 has 32 KB AHB RAM which allows for\r
  * allocating a buffer size of at least 7500 events without affecting the main\r
- * RAM. To place RecorderData in this RAM bank using IAR Embedded Workbench \r
+ * RAM. To place RecorderData in this RAM bank using IAR Embedded Workbench\r
  * for ARM, use this pragma right before the declaration:\r
  *\r
  *      #pragma location="AHB_RAM_MEMORY"\r
  *\r
  * This of course works for other hardware architectures with additional RAM\r
- * banks as well, just replace "AHB_RAM_MEMORY" with the section name from the \r
+ * banks as well, just replace "AHB_RAM_MEMORY" with the section name from the\r
  * linker .map file, or simply the desired address.\r
  *\r
- * For portability reasons, we don't add the pragma directly in trcBase.c, but \r
+ * For portability reasons, we don't add the pragma directly in trcBase.c, but\r
  * in a header file included below. To include this header, you need to enable\r
  * USE_LINKER_PRAGMA, defined in trcConfig.h.\r
  *\r
  * If using GCC, you need to modify the declaration as follows:\r
  *\r
  *      RecorderDataType RecorderData __attribute__ ((section ("name"))) = ...\r
- * \r
+ *\r
  * Remember to replace "name" with the correct section name.\r
  ******************************************************************************/\r
 \r
@@ -113,9 +113,9 @@ RecorderDataType* RecorderDataPtr = NULL;
 \r
 /* This version of the function dynamically allocates the trace data */\r
 void prvTraceInitTraceData()\r
-{              \r
+{\r
        init_hwtc_count = HWTC_COUNT;\r
-       \r
+\r
 #if TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_STATIC\r
        RecorderDataPtr = &RecorderData;\r
 #elif TRACE_DATA_ALLOCATION == TRACE_DATA_ALLOCATION_DYNAMIC\r
@@ -132,7 +132,7 @@ void prvTraceInitTraceData()
                vTraceError("No recorder data structure allocated!");\r
                return;\r
        }\r
-               \r
+\r
        (void)memset(RecorderDataPtr, 0, sizeof(RecorderDataType));\r
 \r
        RecorderDataPtr->startmarker0 = 0x00;\r
@@ -196,7 +196,7 @@ void prvTraceInitTraceData()
 \r
        /* Fix the start markers of the trace data structure */\r
        vInitStartMarkers();\r
-       \r
+\r
        #ifdef PORT_SPECIFIC_INIT\r
        PORT_SPECIFIC_INIT();\r
        #endif\r
@@ -242,15 +242,15 @@ void* xTraceNextFreeEventBufferSlot(void)
 \r
 uint16_t uiIndexOfObject(objectHandleType objecthandle, uint8_t objectclass)\r
 {\r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "uiIndexOfObject: Invalid value for objectclass", 0);\r
-       TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+       TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
                "uiIndexOfObject: Invalid value for objecthandle", 0);\r
 \r
-       if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) && \r
+       if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) &&\r
                (objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))\r
        {\r
-               return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] + \r
+               return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] +\r
                        (RecorderDataPtr->ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * (objecthandle-1)));\r
        }\r
 \r
@@ -286,7 +286,7 @@ objectHandleType xTraceGetObjectHandle(traceObjectClass objectclass)
        objectHandleType handle;\r
        static int indexOfHandle;\r
 \r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "xTraceGetObjectHandle: Invalid value for objectclass", (objectHandleType)0);\r
 \r
        indexOfHandle = objectHandleStacks.indexOfNextAvailableHandle[objectclass];\r
@@ -335,9 +335,9 @@ void vTraceFreeObjectHandle(traceObjectClass objectclass, objectHandleType handl
 {\r
        int indexOfHandle;\r
 \r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "vTraceFreeObjectHandle: Invalid value for objectclass", );\r
-       TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+       TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
                "vTraceFreeObjectHandle: Invalid value for handle", );\r
 \r
        /* Check that there is room to push the handle on the stack */\r
@@ -421,10 +421,10 @@ traceLabel prvTraceOpenSymbol(const char* name, traceLabel userEventChannel)
        uint8_t len;\r
        uint8_t crc;\r
        TRACE_SR_ALLOC_CRITICAL_SECTION();\r
-       \r
+\r
        len = 0;\r
        crc = 0;\r
-       \r
+\r
        TRACE_ASSERT(name != NULL, "prvTraceOpenSymbol: name == NULL", (traceLabel)0);\r
 \r
        prvTraceGetChecksum(name, &crc, &len);\r
@@ -470,9 +470,9 @@ void vTraceError(const char* msg)
        {\r
                traceErrorMessage = (char*)msg;\r
                (void)strncpy(RecorderDataPtr->systemInfo, traceErrorMessage, 80);\r
-               RecorderDataPtr->internalErrorOccured = 1;               \r
+               RecorderDataPtr->internalErrorOccured = 1;\r
        }\r
-       \r
+\r
 }\r
 \r
 /******************************************************************************\r
@@ -496,7 +496,7 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
        unsigned int i = 0;\r
        unsigned int e = 0;\r
 \r
-       TRACE_ASSERT(nofEntriesToCheck != 0, \r
+       TRACE_ASSERT(nofEntriesToCheck != 0,\r
                "prvCheckDataToBeOverwrittenForMultiEntryEvents: nofEntriesToCheck == 0", );\r
 \r
        while (i < nofEntriesToCheck)\r
@@ -535,12 +535,12 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
  * Updates the index of the event buffer.\r
  ******************************************************************************/\r
 void prvTraceUpdateCounters(void)\r
-{      \r
+{\r
        if (RecorderDataPtr->recorderActive == 0)\r
        {\r
                return;\r
        }\r
-       \r
+\r
        RecorderDataPtr->numEvents++;\r
 \r
        RecorderDataPtr->nextFreeIndex++;\r
@@ -584,9 +584,9 @@ uint16_t prvTraceGetDTS(uint16_t param_maxDTS)
        if (RecorderDataPtr->frequency == 0 && init_hwtc_count != HWTC_COUNT)\r
        {\r
                /* If HWTC_PERIOD is mapped to the timer reload register,\r
-               it might not be initialized     before the scheduler has been started. \r
+               it might not be initialized     before the scheduler has been started.\r
                We therefore store the frequency of the timer when the counter\r
-               register has changed from its initial value. \r
+               register has changed from its initial value.\r
                (Note that this function is called also by vTraceStart and\r
                uiTraceStart, which might be called before the scheduler\r
                has been started.) */\r
@@ -605,9 +605,9 @@ uint16_t prvTraceGetDTS(uint16_t param_maxDTS)
        * If necessary, whole seconds are extracted using division while the rest\r
        * comes from the modulo operation.\r
        **************************************************************************/\r
-       \r
-       vTracePortGetTimeStamp(&timestamp);     \r
-       \r
+\r
+       vTracePortGetTimeStamp(&timestamp);\r
+\r
        /***************************************************************************\r
        * Since dts is unsigned the result will be correct even if timestamp has\r
        * wrapped around.\r
@@ -818,14 +818,14 @@ void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength)
 \r
 #if (USE_16BIT_OBJECT_HANDLES == 1)\r
 \r
-void prvTraceStoreXID(objectHandleType handle); \r
+void prvTraceStoreXID(objectHandleType handle);\r
 \r
 /******************************************************************************\r
  * prvTraceStoreXID\r
  *\r
  * Stores an XID (eXtended IDentifier) event.\r
  * This is used if an object/task handle is larger than 255.\r
- * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or \r
+ * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or\r
  * larger. Handles below 256 should not use this function.\r
  *\r
  * NOTE: this function MUST be called from within a critical section.\r
@@ -844,7 +844,7 @@ void prvTraceStoreXID(objectHandleType handle)
                xid->type = XID;\r
 \r
                /* This function is (only) used when objectHandleType is 16 bit... */\r
-               xid->xps_16 = handle; \r
+               xid->xps_16 = handle;\r
 \r
                prvTraceUpdateCounters();\r
        }\r
@@ -853,11 +853,11 @@ void prvTraceStoreXID(objectHandleType handle)
 unsigned char prvTraceGet8BitHandle(objectHandleType handle)\r
 {\r
        if (handle > 255)\r
-       {               \r
+       {\r
                prvTraceStoreXID(handle);\r
-               /* The full handle (16 bit) is stored in the XID event. \r
+               /* The full handle (16 bit) is stored in the XID event.\r
                This code (255) is used instead of zero (which is an error code).*/\r
-               return 255; \r
+               return 255;\r
        }\r
        return (unsigned char)(handle & 0xFF);\r
 }\r
index 7d02f23d2d879b009f6cabda05bf67f8d828beb0..a98e456f30828f68b71a1375b5b2a9848032fef5 100644 (file)
@@ -156,6 +156,8 @@ to exclude the API function. */
 #define INCLUDE_vTaskDelay                                             1\r
 #define INCLUDE_xTimerPendFunctionCall                 1\r
 #define INCLUDE_eTaskGetState                                  1\r
+#define INCLUDE_xTaskAbortDelay                                        1\r
+#define INCLUDE_xTaskGetTaskHandle                             1\r
 \r
 /* This demo makes use of one or more example stats formatting functions.  These\r
 format the raw data provided by the uxTaskGetSystemState() function in to human\r
index 9d0a25de15e1f20f0cb039d9692ddc2f91d32f3b..33cebedce3d1c5a756eb09b13a49b70631b755c5 100644 (file)
 #include "TaskNotify.h"\r
 #include "IntSemTest.h"\r
 #include "StaticAllocation.h"\r
+#include "AbortDelay.h"\r
+\r
 \r
 /* Priorities for the demo application tasks. */\r
 #define mainSEM_TEST_PRIORITY                          ( tskIDLE_PRIORITY + 1UL )\r
@@ -260,6 +262,7 @@ void main_full( void )
        vStartTaskNotifyTask();\r
        vStartInterruptSemaphoreTasks();\r
        vStartStaticallyAllocatedTasks();\r
+       vCreateAbortDelayTasks();\r
 \r
        /* Start the tasks that implements the command console on the UART, as\r
        described above. */\r
@@ -406,17 +409,22 @@ unsigned long ulErrorFound = pdFALSE;
                        ulErrorFound |= 1UL << 15UL;\r
                }\r
 \r
+               if( xAreAbortDelayTestTasksStillRunning() != pdPASS )\r
+               {\r
+                       ulErrorFound |= 1UL << 16UL;\r
+               }\r
+\r
                /* Check that the register test 1 task is still running. */\r
                if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
                {\r
-                       ulErrorFound |= 1UL << 16UL;\r
+                       ulErrorFound |= 1UL << 17UL;\r
                }\r
                ulLastRegTest1Value = ulRegTest1LoopCounter;\r
 \r
                /* Check that the register test 2 task is still running. */\r
                if( ulLastRegTest2Value == ulRegTest2LoopCounter )\r
                {\r
-                       ulErrorFound |= 1UL << 17UL;\r
+                       ulErrorFound |= 1UL << 18UL;\r
                }\r
                ulLastRegTest2Value = ulRegTest2LoopCounter;\r
 \r
index b7d05a95232a637cc1d6af04c4220bafb00f42fd..51d7736d31e30c6c0877738e50619f0493ced0da 100644 (file)
@@ -268,7 +268,7 @@ void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName )
 \r
 void vApplicationIdleHook( void )\r
 {\r
-volatile size_t xFreeHeapSpace;\r
+volatile size_t xFreeHeapSpace, xMinimumEverFreeHeapSpace;\r
 \r
        /* This is just a trivial example of an idle hook.  It is called on each\r
        cycle of the idle task.  It must *NOT* attempt to block.  In this case the\r
@@ -278,9 +278,11 @@ volatile size_t xFreeHeapSpace;
        configTOTAL_HEAP_SIZE value in FreeRTOSConfig.h can be reduced to free up\r
        RAM. */\r
        xFreeHeapSpace = xPortGetFreeHeapSize();\r
+       xMinimumEverFreeHeapSpace = xPortGetMinimumEverFreeHeapSize();\r
 \r
        /* Remove compiler warning about xFreeHeapSpace being set but never used. */\r
        ( void ) xFreeHeapSpace;\r
+       ( void ) xMinimumEverFreeHeapSpace;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index 3e4d9c23b6964444dcee434394f3820235a51915..939ec36796307ffffdcafce4cf9751dedeb4f37f 100644 (file)
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_QUEUE_SETS                   1\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
-#define configUSE_ALTERNATIVE_API              1\r
+#define configUSE_ALTERNATIVE_API              0\r
 \r
 #define configMAX_PRIORITIES                   ( 5UL )\r
 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
index 6e6e1005561d76b973b7b9c932e1e26826f31c77..21e57d388e3fddafaa17466a68e585089bb87123 100644 (file)
@@ -215,7 +215,7 @@ header file. */
 \r
 /* LED not used at present, so just increment a variable to keep a count of the\r
 number of times the LED would otherwise have been toggled. */\r
-#define mainTOGGLE_LED()       ulLED++\r
+#define configTOGGLE_LED()     ulLED++\r
 \r
 \r
 #ifdef __cplusplus\r
index 9a0f5ccfb462f1b54d9ff6823e0ad7099d022fba..59ad59951efb7cb276d4aa6d68e9e3d69f831da6 100644 (file)
@@ -73,7 +73,7 @@
         <LExpSel>0</LExpSel>
       </OPTXL>
       <OPTFL>
-        <tvExp>0</tvExp>
+        <tvExp>1</tvExp>
         <tvExpOptDlg>0</tvExpOptDlg>
         <IsCurrentTarget>1</IsCurrentTarget>
       </OPTFL>
       <GroupNumber>3</GroupNumber>
       <FileNumber>11</FileNumber>
       <FileType>1</FileType>
-      <tvExp>1</tvExp>
+      <tvExp>0</tvExp>
       <tvExpOptDlg>0</tvExpOptDlg>
       <bDave2>0</bDave2>
       <PathWithFileName>..\..\..\Source\portable\RVDS\ARM_CM4F\port.c</PathWithFileName>
 
   <Group>
     <GroupName>main_low_power</GroupName>
-    <tvExp>0</tvExp>
+    <tvExp>1</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
 
   <Group>
     <GroupName>main_full</GroupName>
-    <tvExp>1</tvExp>
+    <tvExp>0</tvExp>
     <tvExpOptDlg>0</tvExpOptDlg>
     <cbSel>0</cbSel>
     <RteFlg>0</RteFlg>
index 507c52a6aaf6fc44405d021936599a7a7de69127..2e18a2d1936d5241ba66ba03c7231577b74e179f 100644 (file)
@@ -363,7 +363,7 @@ unsigned long ulErrorFound = pdFALSE;
                /* Toggle the check LED to give an indication of the system status.  If\r
                the LED toggles every mainNO_ERROR_CHECK_TASK_PERIOD milliseconds then\r
                everything is ok.  A faster toggle indicates an error. */\r
-               mainTOGGLE_LED();\r
+               configTOGGLE_LED();\r
 \r
                if( ulErrorFound != pdFALSE )\r
                {\r
index cb4860ed7b9184802dfa25c8167fe0543fc11a28..26659dedf01aece4edd995c63cc08073af0a440c 100644 (file)
@@ -225,9 +225,9 @@ const TickType_t xShortDelay = pdMS_TO_TICKS( 10 );
                {\r
                        /* Blip the LED briefly to show the demo is running, but without\r
                        leaving the LED on too long as energy is being conserved. */\r
-                       mainTOGGLE_LED();\r
+                       configTOGGLE_LED();\r
                        vTaskDelay( xShortDelay );\r
-                       mainTOGGLE_LED();\r
+                       configTOGGLE_LED();\r
 \r
                        ulReceivedValue = 0U;\r
                }\r
diff --git a/FreeRTOS/Demo/Common/Minimal/AbortDelay.c b/FreeRTOS/Demo/Common/Minimal/AbortDelay.c
new file mode 100644 (file)
index 0000000..9ddba7c
--- /dev/null
@@ -0,0 +1,650 @@
+/*\r
+    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
+\r
+    ***************************************************************************\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+    ***************************************************************************\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
+\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
+\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+/*\r
+ * This file contains some test scenarios that ensure tasks respond correctly\r
+ * to xTaskAbortDelay() calls.\r
+ */\r
+\r
+/* Standard includes. */\r
+#include "limits.h"\r
+\r
+/* Kernel includes. */\r
+#include "FreeRTOS.h"\r
+#include "task.h"\r
+#include "queue.h"\r
+#include "semphr.h"\r
+#include "event_groups.h"\r
+\r
+/* Demo includes. */\r
+#include "AbortDelay.h"\r
+\r
+/* This file can only be used if the functionality it tests is included in the\r
+build.  Remove the whole file if this is not the case. */\r
+#if( INCLUDE_xTaskAbortDelay == 1 )\r
+\r
+#if( INCLUDE_xTaskGetTaskHandle != 1 )\r
+       #error This test file uses the xTaskGetTaskHandle() API function so INCLUDE_xTaskGetTaskHandle must be set to 1 in FreeRTOSConfig.h.\r
+#endif\r
+\r
+/* Task priorities.  Allow these to be overridden. */\r
+#ifndef abtCONTROLLING_PRIORITY\r
+       #define abtCONTROLLING_PRIORITY         ( configMAX_PRIORITIES - 3 )\r
+#endif\r
+\r
+#ifndef abtBLOCKING_PRIORITY\r
+       #define abtBLOCKING_PRIORITY    ( configMAX_PRIORITIES - 2 )\r
+#endif\r
+\r
+/* The tests that are performed. */\r
+#define abtNOTIFY_WAIT_ABORTS          0\r
+#define abtNOTIFY_TAKE_ABORTS          1\r
+#define abtDELAY_ABORTS                                2\r
+#define abtDELAY_UNTIL_ABORTS          3\r
+#define abtSEMAPHORE_TAKE_ABORTS       4\r
+#define abtEVENT_GROUP_ABORTS          5\r
+#define abtQUEUE_SEND_ABORTS           6\r
+#define abtMAX_TESTS                           7\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * The two test tasks.  The controlling task specifies which test to executed.\r
+ * More information is provided in the comments within the tasks.\r
+ */\r
+static void prvControllingTask( void *pvParameters );\r
+static void prvBlockingTask( void *pvParameters );\r
+\r
+/*\r
+ * Test functions called by the blocking task.  Each function follows the same\r
+ * pattern, but the way the task blocks is different in each case.\r
+ *\r
+ * In each function three blocking calls are made.  The first and third\r
+ * blocking call is expected to time out, while the middle blocking call is\r
+ * expected to be aborted by the controlling task half way through the block\r
+ * time.\r
+ */\r
+static void prvTestAbortingTaskNotifyWait( void );\r
+static void prvTestAbortingTaskNotifyTake( void );\r
+static void prvTestAbortingTaskDelay( void );\r
+static void prvTestAbortingTaskDelayUntil( void );\r
+static void prvTestAbortingSemaphoreTake( void );\r
+static void prvTestAbortingEventGroupWait( void );\r
+static void prvTestAbortingQueueSend( void );\r
+\r
+/*\r
+ * Checks the amount of time a task spent in the Blocked state is within the\r
+ * expected bounds.\r
+ */\r
+static void prvCheckExpectedTimeIsWithinAnAcceptableMargin( TickType_t xStartTime, TickType_t xExpectedBlockTime );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/* Used to ensure that tasks are still executing without error. */\r
+static volatile BaseType_t xControllingCycles = 0, xBlockingCycles = 0;\r
+static volatile BaseType_t xErrorOccurred = pdFALSE;\r
+\r
+/* Each task needs to know the other tasks handle so they can send signals to\r
+each other.  The handle is obtained from the task's name. */\r
+static const char *pcControllingTaskName = "AbtCtrl", *pcBlockingTaskName = "AbtBlk";\r
+\r
+/* The maximum amount of time a task will block for. */\r
+const TickType_t xMaxBlockTime = pdMS_TO_TICKS( 100 );\r
+const TickType_t xHalfMaxBlockTime = pdMS_TO_TICKS( 50 );\r
+\r
+/* The actual block time is dependent on the priority of other tasks in the\r
+system so the actual block time might be greater than that expected, but it\r
+should be within an acceptable upper bound. */\r
+const TickType_t xAllowableMargin = pdMS_TO_TICKS( 7 );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+void vCreateAbortDelayTasks( void )\r
+{\r
+       /* Create the two test tasks described above. */\r
+       xTaskCreate( prvControllingTask, pcControllingTaskName, configMINIMAL_STACK_SIZE, NULL, abtCONTROLLING_PRIORITY, NULL );\r
+       xTaskCreate( prvBlockingTask, pcBlockingTaskName, configMINIMAL_STACK_SIZE, NULL, abtBLOCKING_PRIORITY, NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvControllingTask( void *pvParameters )\r
+{\r
+TaskHandle_t xBlockingTask;\r
+uint32_t ulTestToPerform = abtNOTIFY_WAIT_ABORTS;\r
+TickType_t xTimeAtStart;\r
+const TickType_t xStartMargin = 2UL;\r
+\r
+       /* Just to remove compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       xBlockingTask = xTaskGetTaskHandle( pcBlockingTaskName );\r
+       configASSERT( xBlockingTask );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Tell the secondary task to perform the next test. */\r
+               xTimeAtStart = xTaskGetTickCount();\r
+               xTaskNotify( xBlockingTask, ulTestToPerform, eSetValueWithOverwrite );\r
+\r
+               /* The secondary task has a higher priority, so will now be in the\r
+               Blocked state to wait for a maximum of xMaxBlockTime.  It expects that\r
+               period to complete with a timeout.  It will then block for\r
+               xMaxBlockTimeAgain, but this time it expects to the block time to abort\r
+               half way through.  Block until it is time to send the abort to the\r
+               secondary task.  xStartMargin is used because this task takes timing\r
+               from the beginning of the test, whereas the blocking task takes timing\r
+               from the entry into the Blocked state - and as the tasks run at\r
+               different priorities, there may be some discrepancy.  Also, temporarily\r
+               raise the priority of the controlling task to that of the blocking\r
+               task to minimise discrepancies. */\r
+               vTaskPrioritySet( NULL, abtBLOCKING_PRIORITY );\r
+               vTaskDelay( xMaxBlockTime + xHalfMaxBlockTime + xStartMargin );\r
+               xTaskAbortDelay( xBlockingTask );\r
+\r
+               /* Reset the priority to the normal controlling priority. */\r
+               vTaskPrioritySet( NULL, abtCONTROLLING_PRIORITY );\r
+\r
+               /* Now wait to be notified that the secondary task has completed its\r
+               test. */\r
+               ulTaskNotifyTake( pdTRUE, portMAX_DELAY );\r
+\r
+               /* Did the entire test run for the expected time, which is two full\r
+               block times plus the half block time caused by calling\r
+               xTaskAbortDelay()? */\r
+               prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, ( xMaxBlockTime + xMaxBlockTime + xHalfMaxBlockTime ) );\r
+\r
+               /* Move onto the next test. */\r
+               ulTestToPerform++;\r
+\r
+               if( ulTestToPerform >= abtMAX_TESTS )\r
+               {\r
+                       ulTestToPerform = 0;\r
+               }\r
+\r
+               /* To indicate this task is still executing. */\r
+               xControllingCycles++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvBlockingTask( void *pvParameters )\r
+{\r
+TaskHandle_t xControllingTask;\r
+uint32_t ulNotificationValue;\r
+\r
+       /* Just to remove compiler warnings. */\r
+       ( void ) pvParameters;\r
+\r
+       xControllingTask = xTaskGetTaskHandle( pcControllingTaskName );\r
+       configASSERT( xControllingTask );\r
+\r
+       for( ;; )\r
+       {\r
+               /* Wait to be notified of the test that is to be performed next. */\r
+               xTaskNotifyWait( 0, ULONG_MAX, &ulNotificationValue, portMAX_DELAY );\r
+\r
+               switch( ulNotificationValue )\r
+               {\r
+                       case abtNOTIFY_WAIT_ABORTS:\r
+                               prvTestAbortingTaskNotifyWait();\r
+                               break;\r
+\r
+                       case abtNOTIFY_TAKE_ABORTS:\r
+                               prvTestAbortingTaskNotifyTake();\r
+                               break;\r
+\r
+                       case abtDELAY_ABORTS:\r
+                               prvTestAbortingTaskDelay();\r
+                               break;\r
+\r
+                       case abtDELAY_UNTIL_ABORTS:\r
+                               prvTestAbortingTaskDelayUntil();\r
+                               break;\r
+\r
+                       case abtSEMAPHORE_TAKE_ABORTS:\r
+                               prvTestAbortingSemaphoreTake();\r
+                               break;\r
+\r
+                       case abtEVENT_GROUP_ABORTS:\r
+                               prvTestAbortingEventGroupWait();\r
+                               break;\r
+\r
+                       case abtQUEUE_SEND_ABORTS:\r
+                               prvTestAbortingQueueSend();\r
+                               break;\r
+\r
+                       default:\r
+                               /* Should not get here. */\r
+                               break;\r
+               }\r
+\r
+               /* Let the primary task know the test is complete. */\r
+               xTaskNotifyGive( xControllingTask );\r
+\r
+               /* To indicate this task is still executing. */\r
+               xBlockingCycles++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingTaskDelayUntil( void )\r
+{\r
+TickType_t xTimeAtStart, xLastBlockTime;\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* Take a copy of the time as it is updated in the call to\r
+       vTaskDelayUntil() but its original value is needed to determine the actual\r
+       time spend in the Blocked state. */\r
+       xLastBlockTime = xTimeAtStart;\r
+\r
+       /* This first delay should just time out. */\r
+       vTaskDelayUntil( &xLastBlockTime, xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through.  Again take a copy of the time as it is updated in the call to\r
+       vTaskDelayUntil() buts its original value is needed to determine the amount\r
+       of time actually spent in the Blocked state. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+       xLastBlockTime = xTimeAtStart;\r
+       vTaskDelayUntil( &xLastBlockTime, xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* As with the other tests, the third block period should not time out. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+       xLastBlockTime = xTimeAtStart;\r
+       vTaskDelayUntil( &xLastBlockTime, xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingTaskDelay( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       vTaskDelay( xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       vTaskDelay( xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       vTaskDelay( xMaxBlockTime );\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingTaskNotifyTake( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+uint32_t ulReturn;\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       ulReturn = ulTaskNotifyTake( pdFALSE, xMaxBlockTime );\r
+       if( ulReturn != 0 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       ulReturn = ulTaskNotifyTake( pdFALSE, xMaxBlockTime );\r
+       if( ulReturn != 0 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       ulReturn = ulTaskNotifyTake( pdFALSE, xMaxBlockTime );\r
+       if( ulReturn != 0 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingEventGroupWait( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+static StaticEventGroup_t xEventGroupBuffer;\r
+EventGroupHandle_t xEventGroup;\r
+EventBits_t xBitsToWaitFor = ( EventBits_t ) 0x01, xReturn;\r
+\r
+       /* Create the event group.  Statically allocated memory is used so the\r
+       creation cannot fail. */\r
+       xEventGroup = xEventGroupCreateStatic( &xEventGroupBuffer );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       xReturn = xEventGroupWaitBits( xEventGroup, xBitsToWaitFor, pdTRUE, pdTRUE, xMaxBlockTime );\r
+       if( xReturn != 0x00 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       xReturn = xEventGroupWaitBits( xEventGroup, xBitsToWaitFor, pdTRUE, pdTRUE, xMaxBlockTime );\r
+       if( xReturn != 0x00 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       xReturn = xEventGroupWaitBits( xEventGroup, xBitsToWaitFor, pdTRUE, pdTRUE, xMaxBlockTime );\r
+       if( xReturn != 0x00 )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Not really necessary in this case, but for completeness. */\r
+       vEventGroupDelete( xEventGroup );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingQueueSend( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+BaseType_t xReturn;\r
+static StaticQueue_t xQueueBuffer;\r
+static uint8_t ucQueueStorage[ sizeof( uint8_t ) ], ucItemToQueue;\r
+const UBaseType_t xQueueLength = ( UBaseType_t ) 1;\r
+QueueHandle_t xQueue;\r
+\r
+       /* Create the queue.  Statically allocated memory is used so the\r
+       creation cannot fail. */\r
+       xQueue = xQueueCreateStatic( xQueueLength, sizeof( uint8_t ), ucQueueStorage, &xQueueBuffer );\r
+\r
+       /* This function tests aborting when in the blocked state waiting to send,\r
+       so the queue must be full.  There is only one space in the queue. */\r
+       xReturn = xQueueSend( xQueue, &ucItemToQueue, xMaxBlockTime );\r
+       if( xReturn != pdPASS )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       xReturn = xQueueSend( xQueue, &ucItemToQueue, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       xReturn = xQueueSend( xQueue, &ucItemToQueue, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       xReturn = xQueueSend( xQueue, &ucItemToQueue, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Not really necessary in this case, but for completeness. */\r
+       vQueueDelete( xQueue );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingSemaphoreTake( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+BaseType_t xReturn;\r
+static StaticSemaphore_t xSemaphoreBuffer;\r
+SemaphoreHandle_t xSemaphore;\r
+\r
+       /* Create the semaphore.  Statically allocated memory is used so the\r
+       creation cannot fail. */\r
+       xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       xReturn = xSemaphoreTake( xSemaphore, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       xReturn = xSemaphoreTake( xSemaphore, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       xReturn = xSemaphoreTake( xSemaphore, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Not really necessary in this case, but for completeness. */\r
+       vSemaphoreDelete( xSemaphore );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvTestAbortingTaskNotifyWait( void )\r
+{\r
+TickType_t xTimeAtStart;\r
+BaseType_t xReturn;\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This first delay should just time out. */\r
+       xReturn = xTaskNotifyWait( 0, 0, NULL, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This second delay should be aborted by the primary task half way\r
+       through. */\r
+       xReturn = xTaskNotifyWait( 0, 0, NULL, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xHalfMaxBlockTime );\r
+\r
+       /* Note the time before the delay so the length of the delay is known. */\r
+       xTimeAtStart = xTaskGetTickCount();\r
+\r
+       /* This third delay should just time out again. */\r
+       xReturn = xTaskNotifyWait( 0, 0, NULL, xMaxBlockTime );\r
+       if( xReturn != pdFALSE )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+       prvCheckExpectedTimeIsWithinAnAcceptableMargin( xTimeAtStart, xMaxBlockTime );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvCheckExpectedTimeIsWithinAnAcceptableMargin( TickType_t xStartTime, TickType_t xExpectedBlockTime )\r
+{\r
+TickType_t xTimeNow, xActualBlockTime;\r
+\r
+       xTimeNow = xTaskGetTickCount();\r
+       xActualBlockTime = xTimeNow - xStartTime;\r
+\r
+       /* The actual block time should not be less than the expected block time. */\r
+       if( xActualBlockTime < xExpectedBlockTime )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d, actual block time %d, expected %d", __LINE__, xActualBlockTime, xExpectedBlockTime );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+\r
+       /* The actual block time can be greater than the expected block time, as it\r
+       depends on the priority of the other tasks, but it should be within an\r
+       acceptable margin. */\r
+       if( xActualBlockTime > ( xExpectedBlockTime + xAllowableMargin ) )\r
+       {\r
+               xErrorOccurred = pdTRUE; printf( "Line %d", __LINE__ );taskDISABLE_INTERRUPTS();for(;;){Sleep( 1000 );}\r
+       }\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+BaseType_t xAreAbortDelayTestTasksStillRunning( void )\r
+{\r
+static BaseType_t xLastControllingCycleCount = 0, xLastBlockingCycleCount = 0;\r
+BaseType_t xReturn = pdPASS;\r
+\r
+       /* Have both tasks performed at least one cycle since this function was\r
+       last called? */\r
+       if( xControllingCycles == xLastControllingCycleCount )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       if( xBlockingCycles == xLastBlockingCycleCount )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       if( xErrorOccurred == pdTRUE )\r
+       {\r
+               xReturn = pdFAIL;\r
+       }\r
+\r
+       xLastBlockingCycleCount = xBlockingCycles;\r
+       xLastControllingCycleCount = xControllingCycles;\r
+\r
+       return xReturn;\r
+}\r
+\r
+#endif /* INCLUDE_xTaskAbortDelay == 1 */\r
diff --git a/FreeRTOS/Demo/Common/Minimal/AltBlckQ.c b/FreeRTOS/Demo/Common/Minimal/AltBlckQ.c
deleted file mode 100644 (file)
index c777323..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-/*\r
- * This is a version of BlockQ.c that uses the alternative (Alt) API.\r
- *\r
- * Creates six tasks that operate on three queues as follows:\r
- *\r
- * The first two tasks send and receive an incrementing number to/from a queue.\r
- * One task acts as a producer and the other as the consumer.  The consumer is a\r
- * higher priority than the producer and is set to block on queue reads.  The queue\r
- * only has space for one item - as soon as the producer posts a message on the\r
- * queue the consumer will unblock, pre-empt the producer, and remove the item.\r
- *\r
- * The second two tasks work the other way around.  Again the queue used only has\r
- * enough space for one item.  This time the consumer has a lower priority than the\r
- * producer.  The producer will try to post on the queue blocking when the queue is\r
- * full.  When the consumer wakes it will remove the item from the queue, causing\r
- * the producer to unblock, pre-empt the consumer, and immediately re-fill the\r
- * queue.\r
- *\r
- * The last two tasks use the same queue producer and consumer functions.  This time the queue has\r
- * enough space for lots of items and the tasks operate at the same priority.  The\r
- * producer will execute, placing items into the queue.  The consumer will start\r
- * executing when either the queue becomes full (causing the producer to block) or\r
- * a context switch occurs (tasks of the same priority will time slice).\r
- *\r
- */\r
-\r
-\r
-#include <stdlib.h>\r
-\r
-/* Scheduler include files. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "queue.h"\r
-\r
-/* Demo program include files. */\r
-#include "AltBlckQ.h"\r
-\r
-#define blckqSTACK_SIZE                configMINIMAL_STACK_SIZE\r
-#define blckqNUM_TASK_SETS     ( 3 )\r
-\r
-/* Structure used to pass parameters to the blocking queue tasks. */\r
-typedef struct BLOCKING_QUEUE_PARAMETERS\r
-{\r
-       QueueHandle_t xQueue;                                   /*< The queue to be used by the task. */\r
-       TickType_t xBlockTime;                          /*< The block time to use on queue reads/writes. */\r
-       volatile short *psCheckVariable;        /*< Incremented on each successful cycle to check the task is still running. */\r
-} xBlockingQueueParameters;\r
-\r
-/* Task function that creates an incrementing number and posts it on a queue. */\r
-static portTASK_FUNCTION_PROTO( vBlockingQueueProducer, pvParameters );\r
-\r
-/* Task function that removes the incrementing number from a queue and checks that\r
-it is the expected number. */\r
-static portTASK_FUNCTION_PROTO( vBlockingQueueConsumer, pvParameters );\r
-\r
-/* Variables which are incremented each time an item is removed from a queue, and\r
-found to be the expected value.\r
-These are used to check that the tasks are still running. */\r
-static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
-\r
-/* Variable which are incremented each time an item is posted on a queue.   These\r
-are used to check that the tasks are still running. */\r
-static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void vStartAltBlockingQueueTasks( UBaseType_t uxPriority )\r
-{\r
-xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;\r
-xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;\r
-xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;\r
-const UBaseType_t uxQueueSize1 = 1, uxQueueSize5 = 5;\r
-const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;\r
-const TickType_t xDontBlock = ( TickType_t ) 0;\r
-\r
-       /* Create the first two tasks as described at the top of the file. */\r
-       \r
-       /* First create the structure used to pass parameters to the consumer tasks. */\r
-       pxQueueParameters1 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-\r
-       /* Create the queue used by the first two tasks to pass the incrementing number.\r
-       Pass a pointer to the queue in the parameter structure. */\r
-       pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
-\r
-       /* The consumer is created first so gets a block time as described above. */\r
-       pxQueueParameters1->xBlockTime = xBlockTime;\r
-\r
-       /* Pass in the variable that this task is going to increment so we can check it\r
-       is still running. */\r
-       pxQueueParameters1->psCheckVariable = &( sBlockingConsumerCount[ 0 ] );\r
-               \r
-       /* Create the structure used to pass parameters to the producer task. */\r
-       pxQueueParameters2 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-\r
-       /* Pass the queue to this task also, using the parameter structure. */\r
-       pxQueueParameters2->xQueue = pxQueueParameters1->xQueue;\r
-\r
-       /* The producer is not going to block - as soon as it posts the consumer will\r
-       wake and remove the item so the producer should always have room to post. */\r
-       pxQueueParameters2->xBlockTime = xDontBlock;\r
-\r
-       /* Pass in the variable that this task is going to increment so we can check\r
-       it is still running. */\r
-       pxQueueParameters2->psCheckVariable = &( sBlockingProducerCount[ 0 ] );\r
-\r
-\r
-       /* Note the producer has a lower priority than the consumer when the tasks are\r
-       spawned. */\r
-       xTaskCreate( vBlockingQueueConsumer, "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );\r
-       xTaskCreate( vBlockingQueueProducer, "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );\r
-\r
-       \r
-\r
-       /* Create the second two tasks as described at the top of the file.   This uses\r
-       the same mechanism but reverses the task priorities. */\r
-\r
-       pxQueueParameters3 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-       pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
-       pxQueueParameters3->xBlockTime = xDontBlock;\r
-       pxQueueParameters3->psCheckVariable = &( sBlockingProducerCount[ 1 ] );\r
-\r
-       pxQueueParameters4 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-       pxQueueParameters4->xQueue = pxQueueParameters3->xQueue;\r
-       pxQueueParameters4->xBlockTime = xBlockTime;\r
-       pxQueueParameters4->psCheckVariable = &( sBlockingConsumerCount[ 1 ] );\r
-\r
-       xTaskCreate( vBlockingQueueConsumer, "QProdB3", blckqSTACK_SIZE, ( void * ) pxQueueParameters3, tskIDLE_PRIORITY, NULL );\r
-       xTaskCreate( vBlockingQueueProducer, "QConsB4", blckqSTACK_SIZE, ( void * ) pxQueueParameters4, uxPriority, NULL );\r
-\r
-\r
-\r
-       /* Create the last two tasks as described above.  The mechanism is again just\r
-       the same.  This time both parameter structures are given a block time. */\r
-       pxQueueParameters5 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-       pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( UBaseType_t ) sizeof( uint16_t ) );\r
-       pxQueueParameters5->xBlockTime = xBlockTime;\r
-       pxQueueParameters5->psCheckVariable = &( sBlockingProducerCount[ 2 ] );\r
-\r
-       pxQueueParameters6 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
-       pxQueueParameters6->xQueue = pxQueueParameters5->xQueue;\r
-       pxQueueParameters6->xBlockTime = xBlockTime;\r
-       pxQueueParameters6->psCheckVariable = &( sBlockingConsumerCount[ 2 ] ); \r
-\r
-       xTaskCreate( vBlockingQueueProducer, "QProdB5", blckqSTACK_SIZE, ( void * ) pxQueueParameters5, tskIDLE_PRIORITY, NULL );\r
-       xTaskCreate( vBlockingQueueConsumer, "QConsB6", blckqSTACK_SIZE, ( void * ) pxQueueParameters6, tskIDLE_PRIORITY, NULL );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static portTASK_FUNCTION( vBlockingQueueProducer, pvParameters )\r
-{\r
-uint16_t usValue = 0;\r
-xBlockingQueueParameters *pxQueueParameters;\r
-short sErrorEverOccurred = pdFALSE;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt blocking queue producer task started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       pxQueueParameters = ( xBlockingQueueParameters * ) pvParameters;\r
-\r
-       for( ;; )\r
-       {               \r
-               if( xQueueAltSendToBack( pxQueueParameters->xQueue, ( void * ) &usValue, pxQueueParameters->xBlockTime ) != pdPASS )\r
-               {\r
-                       sErrorEverOccurred = pdTRUE;\r
-               }\r
-               else\r
-               {\r
-                       /* We have successfully posted a message, so increment the variable\r
-                       used to check we are still running. */\r
-                       if( sErrorEverOccurred == pdFALSE )\r
-                       {\r
-                               ( *pxQueueParameters->psCheckVariable )++;\r
-                       }\r
-\r
-                       /* Increment the variable we are going to post next time round.  The\r
-                       consumer will expect the numbers to     follow in numerical order. */\r
-                       ++usValue;\r
-               }\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )\r
-{\r
-uint16_t usData, usExpectedValue = 0;\r
-xBlockingQueueParameters *pxQueueParameters;\r
-short sErrorEverOccurred = pdFALSE;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       pxQueueParameters = ( xBlockingQueueParameters * ) pvParameters;\r
-\r
-       for( ;; )\r
-       {       \r
-               if( xQueueAltReceive( pxQueueParameters->xQueue, &usData, pxQueueParameters->xBlockTime ) == pdPASS )\r
-               {\r
-                       if( usData != usExpectedValue )\r
-                       {\r
-                               /* Catch-up. */\r
-                               usExpectedValue = usData;\r
-\r
-                               sErrorEverOccurred = pdTRUE;\r
-                       }\r
-                       else\r
-                       {\r
-                               /* We have successfully received a message, so increment the\r
-                               variable used to check we are still running. */ \r
-                               if( sErrorEverOccurred == pdFALSE )\r
-                               {\r
-                                       ( *pxQueueParameters->psCheckVariable )++;\r
-                               }\r
-                                                       \r
-                               /* Increment the value we expect to remove from the queue next time\r
-                               round. */\r
-                               ++usExpectedValue;\r
-                       }                       \r
-               }               \r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This is called to check that all the created tasks are still running. */\r
-BaseType_t xAreAltBlockingQueuesStillRunning( void )\r
-{\r
-static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
-static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
-BaseType_t xReturn = pdPASS, xTasks;\r
-\r
-       /* Not too worried about mutual exclusion on these variables as they are 16\r
-       bits and we are only reading them. We also only care to see if they have\r
-       changed or not.\r
-       \r
-       Loop through each check variable to and return pdFALSE if any are found not\r
-       to have changed since the last call. */\r
-\r
-       for( xTasks = 0; xTasks < blckqNUM_TASK_SETS; xTasks++ )\r
-       {\r
-               if( sBlockingConsumerCount[ xTasks ] == sLastBlockingConsumerCount[ xTasks ]  )\r
-               {\r
-                       xReturn = pdFALSE;\r
-               }\r
-               sLastBlockingConsumerCount[ xTasks ] = sBlockingConsumerCount[ xTasks ];\r
-\r
-\r
-               if( sBlockingProducerCount[ xTasks ] == sLastBlockingProducerCount[ xTasks ]  )\r
-               {\r
-                       xReturn = pdFALSE;\r
-               }\r
-               sLastBlockingProducerCount[ xTasks ] = sBlockingProducerCount[ xTasks ];\r
-       }\r
-\r
-       return xReturn;\r
-}\r
-\r
diff --git a/FreeRTOS/Demo/Common/Minimal/AltBlock.c b/FreeRTOS/Demo/Common/Minimal/AltBlock.c
deleted file mode 100644 (file)
index 30c1fcd..0000000
+++ /dev/null
@@ -1,553 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-/*\r
- * This is a version of BlockTim.c that uses the light weight API.\r
- *\r
- * This file contains some test scenarios that ensure tasks do not exit queue\r
- * send or receive functions prematurely.  A description of the tests is\r
- * included within the code.\r
- */\r
-\r
-/* Kernel includes. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "queue.h"\r
-\r
-/* Demo includes. */\r
-#include "AltBlock.h"\r
-\r
-/* Task priorities. */\r
-#define bktPRIMARY_PRIORITY                    ( 3 )\r
-#define bktSECONDARY_PRIORITY          ( 2 )\r
-\r
-/* Task behaviour. */\r
-#define bktQUEUE_LENGTH                                ( 5 )\r
-#define bktSHORT_WAIT                          ( ( ( TickType_t ) 20 ) / portTICK_PERIOD_MS )\r
-#define bktPRIMARY_BLOCK_TIME          ( 10 )\r
-#define bktALLOWABLE_MARGIN                    ( 12 )\r
-#define bktTIME_TO_BLOCK                       ( 175 )\r
-#define bktDONT_BLOCK                          ( ( TickType_t ) 0 )\r
-#define bktRUN_INDICATOR                       ( ( UBaseType_t ) 0x55 )\r
-\r
-/* The queue on which the tasks block. */\r
-static QueueHandle_t xTestQueue;\r
-\r
-/* Handle to the secondary task is required by the primary task for calls\r
-to vTaskSuspend/Resume(). */\r
-static TaskHandle_t xSecondary;\r
-\r
-/* Used to ensure that tasks are still executing without error. */\r
-static BaseType_t xPrimaryCycles = 0, xSecondaryCycles = 0;\r
-static BaseType_t xErrorOccurred = pdFALSE;\r
-\r
-/* Provides a simple mechanism for the primary task to know when the\r
-secondary task has executed. */\r
-static volatile UBaseType_t xRunIndicator;\r
-\r
-/* The two test tasks.  Their behaviour is commented within the files. */\r
-static void vPrimaryBlockTimeTestTask( void *pvParameters );\r
-static void vSecondaryBlockTimeTestTask( void *pvParameters );\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void vCreateAltBlockTimeTasks( void )\r
-{\r
-       /* Create the queue on which the two tasks block. */\r
-    xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );\r
-\r
-       /* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
-       in use.  The queue registry is provided as a means for kernel aware \r
-       debuggers to locate queues and has no purpose if a kernel aware debugger\r
-       is not being used.  The call to vQueueAddToRegistry() will be removed\r
-       by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
-       defined to be less than 1. */\r
-       vQueueAddToRegistry( xTestQueue, "AltBlockQueue" );\r
-\r
-\r
-       /* Create the two test tasks. */\r
-       xTaskCreate( vPrimaryBlockTimeTestTask, "FBTest1", configMINIMAL_STACK_SIZE, NULL, bktPRIMARY_PRIORITY, NULL );\r
-       xTaskCreate( vSecondaryBlockTimeTestTask, "FBTest2", configMINIMAL_STACK_SIZE, NULL, bktSECONDARY_PRIORITY, &xSecondary );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void vPrimaryBlockTimeTestTask( void *pvParameters )\r
-{\r
-BaseType_t xItem, xData;\r
-TickType_t xTimeWhenBlocking;\r
-TickType_t xTimeToBlock, xBlockedTime;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt primary block time test started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       ( void ) pvParameters;\r
-\r
-       for( ;; )\r
-       {\r
-               /*********************************************************************\r
-        Test 1\r
-\r
-        Simple block time wakeup test on queue receives. */\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       /* The queue is empty. Attempt to read from the queue using a block\r
-                       time.  When we wake, ensure the delta in time is as expected. */\r
-                       xTimeToBlock = bktPRIMARY_BLOCK_TIME << xItem;\r
-\r
-                       /* A critical section is used to minimise the jitter in the time\r
-                       measurements. */\r
-                       portENTER_CRITICAL();\r
-                       {\r
-                               xTimeWhenBlocking = xTaskGetTickCount();\r
-                               \r
-                               /* We should unblock after xTimeToBlock having not received\r
-                               anything on the queue. */\r
-                               if( xQueueAltReceive( xTestQueue, &xData, xTimeToBlock ) != errQUEUE_EMPTY )\r
-                               {\r
-                                       xErrorOccurred = pdTRUE;\r
-                               }\r
-\r
-                               /* How long were we blocked for? */\r
-                               xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;\r
-                       }\r
-                       portEXIT_CRITICAL();\r
-\r
-                       if( xBlockedTime < xTimeToBlock )\r
-                       {\r
-                               /* Should not have blocked for less than we requested. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       if( xBlockedTime > ( xTimeToBlock + bktALLOWABLE_MARGIN ) )\r
-                       {\r
-                               /* Should not have blocked for longer than we requested,\r
-                               although we would not necessarily run as soon as we were\r
-                               unblocked so a margin is allowed. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-               }\r
-\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-\r
-               /*********************************************************************\r
-        Test 2\r
-\r
-        Simple block time wakeup test on queue sends.\r
-\r
-               First fill the queue.  It should be empty so all sends should pass. */\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       if( xQueueAltSendToBack( xTestQueue, &xItem, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-               }\r
-\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       /* The queue is full. Attempt to write to the queue using a block\r
-                       time.  When we wake, ensure the delta in time is as expected. */\r
-                       xTimeToBlock = bktPRIMARY_BLOCK_TIME << xItem;\r
-\r
-                       portENTER_CRITICAL();\r
-                       {\r
-                               xTimeWhenBlocking = xTaskGetTickCount();\r
-                               \r
-                               /* We should unblock after xTimeToBlock having not received\r
-                               anything on the queue. */\r
-                               if( xQueueAltSendToBack( xTestQueue, &xItem, xTimeToBlock ) != errQUEUE_FULL )\r
-                               {\r
-                                       xErrorOccurred = pdTRUE;\r
-                               }\r
-\r
-                               /* How long were we blocked for? */\r
-                               xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;\r
-                       }\r
-                       portEXIT_CRITICAL();\r
-\r
-                       if( xBlockedTime < xTimeToBlock )\r
-                       {\r
-                               /* Should not have blocked for less than we requested. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       if( xBlockedTime > ( xTimeToBlock + bktALLOWABLE_MARGIN ) )\r
-                       {\r
-                               /* Should not have blocked for longer than we requested,\r
-                               although we would not necessarily run as soon as we were\r
-                               unblocked so a margin is allowed. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-               }\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-               \r
-               /*********************************************************************\r
-        Test 3\r
-\r
-               Wake the other task, it will block attempting to post to the queue.\r
-               When we read from the queue the other task will wake, but before it\r
-               can run we will post to the queue again.  When the other task runs it\r
-               will find the queue still full, even though it was woken.  It should\r
-               recognise that its block time has not expired and return to block for\r
-               the remains of its block time.\r
-\r
-               Wake the other task so it blocks attempting to post to the already\r
-               full queue. */\r
-               xRunIndicator = 0;\r
-               vTaskResume( xSecondary );\r
-\r
-               /* We need to wait a little to ensure the other task executes. */\r
-               while( xRunIndicator != bktRUN_INDICATOR )\r
-               {\r
-                       /* The other task has not yet executed. */\r
-                       vTaskDelay( bktSHORT_WAIT );\r
-               }\r
-               /* Make sure the other task is blocked on the queue. */\r
-               vTaskDelay( bktSHORT_WAIT );\r
-               xRunIndicator = 0;\r
-\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       /* Now when we make space on the queue the other task should wake\r
-                       but not execute as this task has higher priority. */                            \r
-                       if( xQueueAltReceive( xTestQueue, &xData, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* Now fill the queue again before the other task gets a chance to\r
-                       execute.  If the other task had executed we would find the queue\r
-                       full ourselves, and the other task have set xRunIndicator. */\r
-                       if( xQueueAltSendToBack( xTestQueue, &xItem, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       if( xRunIndicator == bktRUN_INDICATOR )\r
-                       {\r
-                               /* The other task should not have executed. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* Raise the priority of the other task so it executes and blocks\r
-                       on the queue again. */\r
-                       vTaskPrioritySet( xSecondary, bktPRIMARY_PRIORITY + 2 );\r
-\r
-                       /* The other task should now have re-blocked without exiting the\r
-                       queue function. */\r
-                       if( xRunIndicator == bktRUN_INDICATOR )\r
-                       {\r
-                               /* The other task should not have executed outside of the\r
-                               queue function. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* Set the priority back down. */\r
-                       vTaskPrioritySet( xSecondary, bktSECONDARY_PRIORITY );                  \r
-               }\r
-\r
-               /* Let the other task timeout.  When it unblockes it will check that it\r
-               unblocked at the correct time, then suspend itself. */\r
-               while( xRunIndicator != bktRUN_INDICATOR )\r
-               {\r
-                       vTaskDelay( bktSHORT_WAIT );\r
-               }\r
-               vTaskDelay( bktSHORT_WAIT );\r
-               xRunIndicator = 0;\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-               /*********************************************************************\r
-        Test 4\r
-\r
-               As per test 3 - but with the send and receive the other way around.\r
-               The other task blocks attempting to read from the queue.\r
-\r
-               Empty the queue.  We should find that it is full. */\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       if( xQueueAltReceive( xTestQueue, &xData, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-               }\r
-               \r
-               /* Wake the other task so it blocks attempting to read from  the\r
-               already empty queue. */\r
-               vTaskResume( xSecondary );\r
-\r
-               /* We need to wait a little to ensure the other task executes. */\r
-               while( xRunIndicator != bktRUN_INDICATOR )\r
-               {\r
-                       vTaskDelay( bktSHORT_WAIT );\r
-               }\r
-               vTaskDelay( bktSHORT_WAIT );\r
-               xRunIndicator = 0;\r
-\r
-               for( xItem = 0; xItem < bktQUEUE_LENGTH; xItem++ )\r
-               {\r
-                       /* Now when we place an item on the queue the other task should\r
-                       wake but not execute as this task has higher priority. */                               \r
-                       if( xQueueAltSendToBack( xTestQueue, &xItem, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* Now empty the queue again before the other task gets a chance to\r
-                       execute.  If the other task had executed we would find the queue\r
-                       empty ourselves, and the other task would be suspended. */\r
-                       if( xQueueAltReceive( xTestQueue, &xData, bktDONT_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       if( xRunIndicator == bktRUN_INDICATOR )\r
-                       {\r
-                               /* The other task should not have executed. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* Raise the priority of the other task so it executes and blocks\r
-                       on the queue again. */\r
-                       vTaskPrioritySet( xSecondary, bktPRIMARY_PRIORITY + 2 );\r
-\r
-                       /* The other task should now have re-blocked without exiting the\r
-                       queue function. */\r
-                       if( xRunIndicator == bktRUN_INDICATOR )\r
-                       {\r
-                               /* The other task should not have executed outside of the\r
-                               queue function. */\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-                       vTaskPrioritySet( xSecondary, bktSECONDARY_PRIORITY );                  \r
-               }\r
-\r
-               /* Let the other task timeout.  When it unblockes it will check that it\r
-               unblocked at the correct time, then suspend itself. */\r
-               while( xRunIndicator != bktRUN_INDICATOR )\r
-               {\r
-                       vTaskDelay( bktSHORT_WAIT );\r
-               }\r
-               vTaskDelay( bktSHORT_WAIT );\r
-\r
-               xPrimaryCycles++;\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void vSecondaryBlockTimeTestTask( void *pvParameters )\r
-{\r
-TickType_t xTimeWhenBlocking, xBlockedTime;\r
-BaseType_t xData;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt secondary block time test started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       ( void ) pvParameters;\r
-\r
-       for( ;; )\r
-       {\r
-               /*********************************************************************\r
-        Test 1 and 2\r
-\r
-               This task does does not participate in these tests. */\r
-               vTaskSuspend( NULL );\r
-\r
-               /*********************************************************************\r
-        Test 3\r
-\r
-               The first thing we do is attempt to read from the queue.  It should be\r
-               full so we block.  Note the time before we block so we can check the\r
-               wake time is as per that expected. */\r
-               portENTER_CRITICAL();\r
-               {\r
-                       xTimeWhenBlocking = xTaskGetTickCount();\r
-                       \r
-                       /* We should unblock after bktTIME_TO_BLOCK having not received\r
-                       anything on the queue. */\r
-                       xData = 0;\r
-                       xRunIndicator = bktRUN_INDICATOR;\r
-                       if( xQueueAltSendToBack( xTestQueue, &xData, bktTIME_TO_BLOCK ) != errQUEUE_FULL )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       /* How long were we inside the send function? */\r
-                       xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;\r
-               }\r
-               portEXIT_CRITICAL();\r
-\r
-               /* We should not have blocked for less time than bktTIME_TO_BLOCK. */\r
-               if( xBlockedTime < bktTIME_TO_BLOCK )\r
-               {\r
-                       xErrorOccurred = pdTRUE;\r
-               }\r
-\r
-               /* We should of not blocked for much longer than bktALLOWABLE_MARGIN\r
-               either.  A margin is permitted as we would not necessarily run as\r
-               soon as we unblocked. */\r
-               if( xBlockedTime > ( bktTIME_TO_BLOCK + bktALLOWABLE_MARGIN ) )\r
-               {\r
-                       xErrorOccurred = pdTRUE;\r
-               }\r
-\r
-               /* Suspend ready for test 3. */\r
-               xRunIndicator = bktRUN_INDICATOR;\r
-               vTaskSuspend( NULL );\r
-\r
-               /*********************************************************************\r
-        Test 4\r
-\r
-               As per test three, but with the send and receive reversed. */\r
-               portENTER_CRITICAL();\r
-               {\r
-                       xTimeWhenBlocking = xTaskGetTickCount();\r
-                       \r
-                       /* We should unblock after bktTIME_TO_BLOCK having not received\r
-                       anything on the queue. */\r
-                       xRunIndicator = bktRUN_INDICATOR;\r
-                       if( xQueueAltReceive( xTestQueue, &xData, bktTIME_TO_BLOCK ) != errQUEUE_EMPTY )\r
-                       {\r
-                               xErrorOccurred = pdTRUE;\r
-                       }\r
-\r
-                       xBlockedTime = xTaskGetTickCount() - xTimeWhenBlocking;\r
-               }\r
-               portEXIT_CRITICAL();\r
-\r
-               /* We should not have blocked for less time than bktTIME_TO_BLOCK. */\r
-               if( xBlockedTime < bktTIME_TO_BLOCK )\r
-               {\r
-                       xErrorOccurred = pdTRUE;\r
-               }\r
-\r
-               /* We should of not blocked for much longer than bktALLOWABLE_MARGIN\r
-               either.  A margin is permitted as we would not necessarily run as soon\r
-               as we unblocked. */\r
-               if( xBlockedTime > ( bktTIME_TO_BLOCK + bktALLOWABLE_MARGIN ) )\r
-               {\r
-                       xErrorOccurred = pdTRUE;\r
-               }\r
-\r
-               xRunIndicator = bktRUN_INDICATOR;\r
-\r
-               xSecondaryCycles++;\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-BaseType_t xAreAltBlockTimeTestTasksStillRunning( void )\r
-{\r
-static BaseType_t xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;\r
-BaseType_t xReturn = pdPASS;\r
-\r
-       /* Have both tasks performed at least one cycle since this function was\r
-       last called? */\r
-       if( xPrimaryCycles == xLastPrimaryCycleCount )\r
-       {\r
-               xReturn = pdFAIL;\r
-       }\r
-\r
-       if( xSecondaryCycles == xLastSecondaryCycleCount )\r
-       {\r
-               xReturn = pdFAIL;\r
-       }\r
-\r
-       if( xErrorOccurred == pdTRUE )\r
-       {\r
-               xReturn = pdFAIL;\r
-       }\r
-\r
-       xLastSecondaryCycleCount = xSecondaryCycles;\r
-       xLastPrimaryCycleCount = xPrimaryCycles;\r
-\r
-       return xReturn;\r
-}\r
diff --git a/FreeRTOS/Demo/Common/Minimal/AltPollQ.c b/FreeRTOS/Demo/Common/Minimal/AltPollQ.c
deleted file mode 100644 (file)
index 63b5d37..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-/*\r
- * This is a version of PollQ.c that uses the alternative (Alt) API.\r
- * \r
- * Creates two tasks that communicate over a single queue.  One task acts as a\r
- * producer, the other a consumer.\r
- *\r
- * The producer loops for three iteration, posting an incrementing number onto the\r
- * queue each cycle.  It then delays for a fixed period before doing exactly the\r
- * same again.\r
- *\r
- * The consumer loops emptying the queue.  Each item removed from the queue is\r
- * checked to ensure it contains the expected value.  When the queue is empty it\r
- * blocks for a fixed period, then does the same again.\r
- *\r
- * All queue access is performed without blocking.  The consumer completely empties\r
- * the queue each time it runs so the producer should never find the queue full.\r
- *\r
- * An error is flagged if the consumer obtains an unexpected value or the producer\r
- * find the queue is full.\r
- */\r
-\r
-/*\r
-Changes from V2.0.0\r
-\r
-       + Delay periods are now specified using variables and constants of\r
-         TickType_t rather than uint32_t.\r
-*/\r
-\r
-#include <stdlib.h>\r
-\r
-/* Scheduler include files. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "queue.h"\r
-\r
-/* Demo program include files. */\r
-#include "AltPollQ.h"\r
-\r
-#define pollqSTACK_SIZE                        configMINIMAL_STACK_SIZE\r
-#define pollqQUEUE_SIZE                        ( 10 )\r
-#define pollqPRODUCER_DELAY            ( ( TickType_t ) 200 / portTICK_PERIOD_MS )\r
-#define pollqCONSUMER_DELAY            ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )\r
-#define pollqNO_DELAY                  ( ( TickType_t ) 0 )\r
-#define pollqVALUES_TO_PRODUCE ( ( BaseType_t ) 3 )\r
-#define pollqINITIAL_VALUE             ( ( BaseType_t ) 0 )\r
-\r
-/* The task that posts the incrementing number onto the queue. */\r
-static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );\r
-\r
-/* The task that empties the queue. */\r
-static portTASK_FUNCTION_PROTO( vPolledQueueConsumer, pvParameters );\r
-\r
-/* Variables that are used to check that the tasks are still running with no\r
-errors. */\r
-static volatile BaseType_t xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void vStartAltPolledQueueTasks( UBaseType_t uxPriority )\r
-{\r
-static QueueHandle_t xPolledQueue;\r
-\r
-       /* Create the queue used by the producer and consumer. */\r
-       xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );\r
-\r
-       /* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
-       in use.  The queue registry is provided as a means for kernel aware \r
-       debuggers to locate queues and has no purpose if a kernel aware debugger\r
-       is not being used.  The call to vQueueAddToRegistry() will be removed\r
-       by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
-       defined to be less than 1. */\r
-       vQueueAddToRegistry( xPolledQueue, "AltPollQueue" );\r
-\r
-\r
-       /* Spawn the producer and consumer. */\r
-       xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
-       xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )\r
-{\r
-uint16_t usValue = ( uint16_t ) 0;\r
-BaseType_t xError = pdFALSE, xLoop;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt polling queue producer task started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       for( ;; )\r
-       {               \r
-               for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )\r
-               {\r
-                       /* Send an incrementing number on the queue without blocking. */\r
-                       if( xQueueAltSendToBack( *( ( QueueHandle_t * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )\r
-                       {\r
-                               /* We should never find the queue full so if we get here there\r
-                               has been an error. */\r
-                               xError = pdTRUE;\r
-                       }\r
-                       else\r
-                       {\r
-                               if( xError == pdFALSE )\r
-                               {\r
-                                       /* If an error has ever been recorded we stop incrementing the\r
-                                       check variable. */\r
-                                       portENTER_CRITICAL();\r
-                                               xPollingProducerCount++;\r
-                                       portEXIT_CRITICAL();\r
-                               }\r
-\r
-                               /* Update the value we are going to post next time around. */\r
-                               usValue++;\r
-                       }\r
-               }\r
-\r
-               /* Wait before we start posting again to ensure the consumer runs and\r
-               empties the queue. */\r
-               vTaskDelay( pollqPRODUCER_DELAY );\r
-       }\r
-}  /*lint !e818 Function prototype must conform to API. */\r
-/*-----------------------------------------------------------*/\r
-\r
-static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )\r
-{\r
-uint16_t usData, usExpectedValue = ( uint16_t ) 0;\r
-BaseType_t xError = pdFALSE;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt blocking queue consumer task started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       for( ;; )\r
-       {               \r
-               /* Loop until the queue is empty. */\r
-               while( uxQueueMessagesWaiting( *( ( QueueHandle_t * ) pvParameters ) ) )\r
-               {\r
-                       if( xQueueAltReceive( *( ( QueueHandle_t * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )\r
-                       {\r
-                               if( usData != usExpectedValue )\r
-                               {\r
-                                       /* This is not what we expected to receive so an error has\r
-                                       occurred. */\r
-                                       xError = pdTRUE;\r
-\r
-                                       /* Catch-up to the value we received so our next expected\r
-                                       value should again be correct. */\r
-                                       usExpectedValue = usData;\r
-                               }\r
-                               else\r
-                               {\r
-                                       if( xError == pdFALSE )\r
-                                       {\r
-                                               /* Only increment the check variable if no errors have\r
-                                               occurred. */\r
-                                               portENTER_CRITICAL();\r
-                                                       xPollingConsumerCount++;\r
-                                               portEXIT_CRITICAL();\r
-                                       }\r
-                               }\r
-\r
-                               /* Next time round we would expect the number to be one higher. */\r
-                               usExpectedValue++;\r
-                       }\r
-               }\r
-\r
-               /* Now the queue is empty we block, allowing the producer to place more\r
-               items in the queue. */\r
-               vTaskDelay( pollqCONSUMER_DELAY );\r
-       }\r
-} /*lint !e818 Function prototype must conform to API. */\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This is called to check that all the created tasks are still running with no errors. */\r
-BaseType_t xAreAltPollingQueuesStillRunning( void )\r
-{\r
-BaseType_t xReturn;\r
-\r
-       /* Check both the consumer and producer poll count to check they have both\r
-       been changed since out last trip round.  We do not need a critical section\r
-       around the check variables as this is called from a higher priority than\r
-       the other tasks that access the same variables. */\r
-       if( ( xPollingConsumerCount == pollqINITIAL_VALUE ) ||\r
-               ( xPollingProducerCount == pollqINITIAL_VALUE )\r
-         )\r
-       {\r
-               xReturn = pdFALSE;\r
-       }\r
-       else\r
-       {\r
-               xReturn = pdTRUE;\r
-       }\r
-\r
-       /* Set the check variables back down so we know if they have been\r
-       incremented the next time around. */\r
-       xPollingConsumerCount = pollqINITIAL_VALUE;\r
-       xPollingProducerCount = pollqINITIAL_VALUE;\r
-\r
-       return xReturn;\r
-}\r
diff --git a/FreeRTOS/Demo/Common/Minimal/AltQTest.c b/FreeRTOS/Demo/Common/Minimal/AltQTest.c
deleted file mode 100644 (file)
index 9188c53..0000000
+++ /dev/null
@@ -1,591 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-\r
-/* \r
- * This file implements the same demo and test as GenQTest.c, but uses the \r
- * light weight API in place of the fully featured API.\r
- *\r
- * See the comments at the top of GenQTest.c for a description.\r
- */\r
-\r
-\r
-#include <stdlib.h>\r
-\r
-/* Scheduler include files. */\r
-#include "FreeRTOS.h"\r
-#include "task.h"\r
-#include "queue.h"\r
-#include "semphr.h"\r
-\r
-/* Demo program include files. */\r
-#include "AltQTest.h"\r
-\r
-#define genqQUEUE_LENGTH               ( 5 )\r
-#define genqNO_BLOCK                   ( 0 )\r
-\r
-#define genqMUTEX_LOW_PRIORITY         ( tskIDLE_PRIORITY )\r
-#define genqMUTEX_TEST_PRIORITY                ( tskIDLE_PRIORITY + 1 )\r
-#define genqMUTEX_MEDIUM_PRIORITY      ( tskIDLE_PRIORITY + 2 )\r
-#define genqMUTEX_HIGH_PRIORITY                ( tskIDLE_PRIORITY + 3 )\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-/*\r
- * Tests the behaviour of the xQueueAltSendToFront() and xQueueAltSendToBack()\r
- * macros by using both to fill a queue, then reading from the queue to\r
- * check the resultant queue order is as expected.  Queue data is also\r
- * peeked.\r
- */\r
-static void prvSendFrontAndBackTest( void *pvParameters );\r
-\r
-/*\r
- * The following three tasks are used to demonstrate the mutex behaviour.\r
- * Each task is given a different priority to demonstrate the priority\r
- * inheritance mechanism.\r
- *\r
- * The low priority task obtains a mutex.  After this a high priority task\r
- * attempts to obtain the same mutex, causing its priority to be inherited\r
- * by the low priority task.  The task with the inherited high priority then\r
- * resumes a medium priority task to ensure it is not blocked by the medium\r
- * priority task while it holds the inherited high priority.  Once the mutex\r
- * is returned the task with the inherited priority returns to its original\r
- * low priority, and is therefore immediately preempted by first the high\r
- * priority task and then the medium prioroity task before it can continue.\r
- */\r
-static void prvLowPriorityMutexTask( void *pvParameters );\r
-static void prvMediumPriorityMutexTask( void *pvParameters );\r
-static void prvHighPriorityMutexTask( void *pvParameters );\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-/* Flag that will be latched to pdTRUE should any unexpected behaviour be\r
-detected in any of the tasks. */\r
-static BaseType_t xErrorDetected = pdFALSE;\r
-\r
-/* Counters that are incremented on each cycle of a test.  This is used to\r
-detect a stalled task - a test that is no longer running. */\r
-static volatile uint32_t ulLoopCounter = 0;\r
-static volatile uint32_t ulLoopCounter2 = 0;\r
-\r
-/* The variable that is guarded by the mutex in the mutex demo tasks. */\r
-static volatile uint32_t ulGuardedVariable = 0;\r
-\r
-/* Handles used in the mutext test to suspend and resume the high and medium\r
-priority mutex test tasks. */\r
-static TaskHandle_t xHighPriorityMutexTask, xMediumPriorityMutexTask;\r
-\r
-/*-----------------------------------------------------------*/\r
-\r
-void vStartAltGenericQueueTasks( UBaseType_t uxPriority )\r
-{\r
-QueueHandle_t xQueue;\r
-SemaphoreHandle_t xMutex;\r
-\r
-       /* Create the queue that we are going to use for the\r
-       prvSendFrontAndBackTest demo. */\r
-       xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( uint32_t ) );\r
-\r
-       /* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
-       in use.  The queue registry is provided as a means for kernel aware \r
-       debuggers to locate queues and has no purpose if a kernel aware debugger\r
-       is not being used.  The call to vQueueAddToRegistry() will be removed\r
-       by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
-       defined to be less than 1. */\r
-       vQueueAddToRegistry( xQueue, "Alt_Gen_Test_Queue" );\r
-\r
-       /* Create the demo task and pass it the queue just created.  We are\r
-       passing the queue handle by value so it does not matter that it is\r
-       declared on the stack here. */\r
-       xTaskCreate( prvSendFrontAndBackTest, "FGenQ", configMINIMAL_STACK_SIZE, ( void * ) xQueue, uxPriority, NULL );\r
-\r
-       /* Create the mutex used by the prvMutexTest task. */\r
-       xMutex = xSemaphoreCreateMutex();\r
-\r
-       /* vQueueAddToRegistry() adds the mutex to the registry, if one is\r
-       in use.  The registry is provided as a means for kernel aware \r
-       debuggers to locate mutex and has no purpose if a kernel aware debugger\r
-       is not being used.  The call to vQueueAddToRegistry() will be removed\r
-       by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is \r
-       defined to be less than 1. */\r
-       vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Alt_Q_Mutex" );\r
-\r
-       /* Create the mutex demo tasks and pass it the mutex just created.  We are\r
-       passing the mutex handle by value so it does not matter that it is declared\r
-       on the stack here. */\r
-       xTaskCreate( prvLowPriorityMutexTask, "FMuLow", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_LOW_PRIORITY, NULL );\r
-       xTaskCreate( prvMediumPriorityMutexTask, "FMuMed", configMINIMAL_STACK_SIZE, NULL, genqMUTEX_MEDIUM_PRIORITY, &xMediumPriorityMutexTask );\r
-       xTaskCreate( prvHighPriorityMutexTask, "FMuHigh", configMINIMAL_STACK_SIZE, ( void * ) xMutex, genqMUTEX_HIGH_PRIORITY, &xHighPriorityMutexTask );\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvSendFrontAndBackTest( void *pvParameters )\r
-{\r
-uint32_t ulData, ulData2;\r
-QueueHandle_t xQueue;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Alt queue SendToFront/SendToBack/Peek test started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       xQueue = ( QueueHandle_t ) pvParameters;\r
-\r
-       for( ;; )\r
-       {\r
-               /* The queue is empty, so sending an item to the back of the queue\r
-               should have the same efect as sending it to the front of the queue.\r
-\r
-               First send to the front and check everything is as expected. */\r
-               xQueueAltSendToFront( xQueue, ( void * ) &ulLoopCounter, genqNO_BLOCK );\r
-\r
-               if( uxQueueMessagesWaiting( xQueue ) != 1 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltReceive( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* The data we sent to the queue should equal the data we just received\r
-               from the queue. */\r
-               if( ulLoopCounter != ulData )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Then do the same, sending the data to the back, checking everything\r
-               is as expected. */\r
-               if( uxQueueMessagesWaiting( xQueue ) != 0 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               xQueueAltSendToBack( xQueue, ( void * ) &ulLoopCounter, genqNO_BLOCK );\r
-\r
-               if( uxQueueMessagesWaiting( xQueue ) != 1 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltReceive( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( uxQueueMessagesWaiting( xQueue ) != 0 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* The data we sent to the queue should equal the data we just received\r
-               from the queue. */\r
-               if( ulLoopCounter != ulData )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-\r
-\r
-               /* Place 2, 3, 4 into the queue, adding items to the back of the queue. */\r
-               for( ulData = 2; ulData < 5; ulData++ )\r
-               {\r
-                       xQueueAltSendToBack( xQueue, ( void * ) &ulData, genqNO_BLOCK );\r
-               }\r
-\r
-               /* Now the order in the queue should be 2, 3, 4, with 2 being the first\r
-               thing to be read out.  Now add 1 then 0 to the front of the queue. */\r
-               if( uxQueueMessagesWaiting( xQueue ) != 3 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-               ulData = 1;\r
-               xQueueAltSendToFront( xQueue, ( void * ) &ulData, genqNO_BLOCK );\r
-               ulData = 0;\r
-               xQueueAltSendToFront( xQueue, ( void * ) &ulData, genqNO_BLOCK );\r
-\r
-               /* Now the queue should be full, and when we read the data out we\r
-               should receive 0, 1, 2, 3, 4. */\r
-               if( uxQueueMessagesWaiting( xQueue ) != 5 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltSendToFront( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != errQUEUE_FULL )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltSendToBack( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != errQUEUE_FULL )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-               /* Check the data we read out is in the expected order. */\r
-               for( ulData = 0; ulData < genqQUEUE_LENGTH; ulData++ )\r
-               {\r
-                       /* Try peeking the data first. */\r
-                       if( xQueueAltPeek( xQueue, &ulData2, genqNO_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-\r
-                       if( ulData != ulData2 )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-                       \r
-\r
-                       /* Now try receiving the data for real.  The value should be the\r
-                       same.  Clobber the value first so we know we really received it. */\r
-                       ulData2 = ~ulData2;\r
-                       if( xQueueAltReceive( xQueue, &ulData2, genqNO_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-\r
-                       if( ulData != ulData2 )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-               }\r
-\r
-               /* The queue should now be empty again. */\r
-               if( uxQueueMessagesWaiting( xQueue ) != 0 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-\r
-               /* Our queue is empty once more, add 10, 11 to the back. */\r
-               ulData = 10;\r
-               if( xQueueAltSendToBack( xQueue, &ulData, genqNO_BLOCK ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-               ulData = 11;\r
-               if( xQueueAltSendToBack( xQueue, &ulData, genqNO_BLOCK ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( uxQueueMessagesWaiting( xQueue ) != 2 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Now we should have 10, 11 in the queue.  Add 7, 8, 9 to the\r
-               front. */\r
-               for( ulData = 9; ulData >= 7; ulData-- )\r
-               {\r
-                       if( xQueueAltSendToFront( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-               }\r
-\r
-               /* Now check that the queue is full, and that receiving data provides\r
-               the expected sequence of 7, 8, 9, 10, 11. */\r
-               if( uxQueueMessagesWaiting( xQueue ) != 5 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltSendToFront( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != errQUEUE_FULL )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               if( xQueueAltSendToBack( xQueue, ( void * ) &ulData, genqNO_BLOCK ) != errQUEUE_FULL )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif\r
-\r
-               /* Check the data we read out is in the expected order. */\r
-               for( ulData = 7; ulData < ( 7 + genqQUEUE_LENGTH ); ulData++ )\r
-               {\r
-                       if( xQueueAltReceive( xQueue, &ulData2, genqNO_BLOCK ) != pdPASS )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-\r
-                       if( ulData != ulData2 )\r
-                       {\r
-                               xErrorDetected = pdTRUE;\r
-                       }\r
-               }\r
-\r
-               if( uxQueueMessagesWaiting( xQueue ) != 0 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               ulLoopCounter++;\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvLowPriorityMutexTask( void *pvParameters )\r
-{\r
-SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;\r
-\r
-       #ifdef USE_STDIO\r
-       void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
-       \r
-               const char * const pcTaskStartMsg = "Fast mutex with priority inheritance test started.\r\n";\r
-\r
-               /* Queue a message for printing to say the task has started. */\r
-               vPrintDisplayMessage( &pcTaskStartMsg );\r
-       #endif\r
-\r
-       ( void ) pvParameters;\r
-\r
-\r
-       for( ;; )\r
-       {\r
-               /* Take the mutex.  It should be available now. */\r
-               if( xSemaphoreAltTake( xMutex, genqNO_BLOCK ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Set our guarded variable to a known start value. */\r
-               ulGuardedVariable = 0;\r
-\r
-               /* Our priority should be as per that assigned when the task was\r
-               created. */\r
-               if( uxTaskPriorityGet( NULL ) != genqMUTEX_LOW_PRIORITY )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Now unsuspend the high priority task.  This will attempt to take the\r
-               mutex, and block when it finds it cannot obtain it. */\r
-               vTaskResume( xHighPriorityMutexTask );\r
-\r
-               /* We should now have inherited the prioritoy of the high priority task,\r
-               as by now it will have attempted to get the mutex. */\r
-               if( uxTaskPriorityGet( NULL ) != genqMUTEX_HIGH_PRIORITY )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* We can attempt to set our priority to the test priority - between the\r
-               idle priority and the medium/high test priorities, but our actual\r
-               prioroity should remain at the high priority. */\r
-               vTaskPrioritySet( NULL, genqMUTEX_TEST_PRIORITY );\r
-               if( uxTaskPriorityGet( NULL ) != genqMUTEX_HIGH_PRIORITY )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Now unsuspend the medium priority task.  This should not run as our\r
-               inherited priority is above that of the medium priority task. */\r
-               vTaskResume( xMediumPriorityMutexTask );\r
-\r
-               /* If the did run then it will have incremented our guarded variable. */\r
-               if( ulGuardedVariable != 0 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* When we give back the semaphore our priority should be disinherited\r
-               back to the priority to which we attempted to set ourselves.  This means\r
-               that when the high priority task next blocks, the medium priority task\r
-               should execute and increment the guarded variable.   When we next run\r
-               both the high and medium priority tasks will have been suspended again. */\r
-               if( xSemaphoreAltGive( xMutex ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Check that the guarded variable did indeed increment... */\r
-               if( ulGuardedVariable != 1 )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* ... and that our priority has been disinherited to\r
-               genqMUTEX_TEST_PRIORITY. */\r
-               if( uxTaskPriorityGet( NULL ) != genqMUTEX_TEST_PRIORITY )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* Set our priority back to our original priority ready for the next\r
-               loop around this test. */\r
-               vTaskPrioritySet( NULL, genqMUTEX_LOW_PRIORITY );\r
-\r
-               /* Just to show we are still running. */\r
-               ulLoopCounter2++;\r
-\r
-               #if configUSE_PREEMPTION == 0\r
-                       taskYIELD();\r
-               #endif          \r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvMediumPriorityMutexTask( void *pvParameters )\r
-{\r
-       ( void ) pvParameters;\r
-\r
-       for( ;; )\r
-       {\r
-               /* The medium priority task starts by suspending itself.  The low\r
-               priority task will unsuspend this task when required. */\r
-               vTaskSuspend( NULL );\r
-\r
-               /* When this task unsuspends all it does is increment the guarded\r
-               variable, this is so the low priority task knows that it has\r
-               executed. */\r
-               ulGuardedVariable++;\r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-static void prvHighPriorityMutexTask( void *pvParameters )\r
-{\r
-SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;\r
-\r
-       ( void ) pvParameters;\r
-\r
-       for( ;; )\r
-       {\r
-               /* The high priority task starts by suspending itself.  The low\r
-               priority task will unsuspend this task when required. */\r
-               vTaskSuspend( NULL );\r
-\r
-               /* When this task unsuspends all it does is attempt to obtain\r
-               the mutex.  It should find the mutex is not available so a\r
-               block time is specified. */\r
-               if( xSemaphoreAltTake( xMutex, portMAX_DELAY ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }\r
-\r
-               /* When we eventually obtain the mutex we just give it back then\r
-               return to suspend ready for the next test. */\r
-               if( xSemaphoreAltGive( xMutex ) != pdPASS )\r
-               {\r
-                       xErrorDetected = pdTRUE;\r
-               }               \r
-       }\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
-/* This is called to check that all the created tasks are still running. */\r
-BaseType_t xAreAltGenericQueueTasksStillRunning( void )\r
-{\r
-static uint32_t ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;\r
-\r
-       /* If the demo task is still running then we expect the loopcounters to\r
-       have incremented since this function was last called. */\r
-       if( ulLastLoopCounter == ulLoopCounter )\r
-       {\r
-               xErrorDetected = pdTRUE;\r
-       }\r
-\r
-       if( ulLastLoopCounter2 == ulLoopCounter2 )\r
-       {\r
-               xErrorDetected = pdTRUE;\r
-       }\r
-\r
-       ulLastLoopCounter = ulLoopCounter;\r
-       ulLastLoopCounter2 = ulLoopCounter2;    \r
-\r
-       /* Errors detected in the task itself will have latched xErrorDetected\r
-       to true. */\r
-\r
-       return !xErrorDetected;\r
-}\r
-\r
-\r
index d53ceab74d9171609bfb589bf0f4b81b6160efe4..571112066791d4e9fbb4279f3443b3517394892a 100644 (file)
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
- * The two test tasks.  Their behaviour is commented within the files.\r
+ * The two test tasks.  Their behaviour is commented within the functions.\r
  */\r
 static void vPrimaryBlockTimeTestTask( void *pvParameters );\r
 static void vSecondaryBlockTimeTestTask( void *pvParameters );\r
@@ -420,7 +420,7 @@ BaseType_t xData;
                /*********************************************************************\r
                Test 0, 1 and 2\r
 \r
-               This task does does not participate in these tests. */\r
+               This task does not participate in these tests. */\r
                vTaskSuspend( NULL );\r
 \r
                /*********************************************************************\r
diff --git a/FreeRTOS/Demo/Common/Minimal/readme.txt b/FreeRTOS/Demo/Common/Minimal/readme.txt
new file mode 100644 (file)
index 0000000..4125d2c
--- /dev/null
@@ -0,0 +1,2 @@
+This directory contains the implementation of the "common demo tasks".  These\r
+are test tasks and demo tasks that are used by nearly all the demo applications.
\ No newline at end of file
diff --git a/FreeRTOS/Demo/Common/include/AbortDelay.h b/FreeRTOS/Demo/Common/include/AbortDelay.h
new file mode 100644 (file)
index 0000000..2aa430a
--- /dev/null
@@ -0,0 +1,78 @@
+/*\r
+    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    All rights reserved\r
+\r
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
+\r
+    ***************************************************************************\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+    ***************************************************************************\r
+\r
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
+     *                                                                       *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
+\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
+\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
+\r
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
+\r
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial middleware.\r
+\r
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
+    engineered and independently SIL3 certified version for use in safety and\r
+    mission critical applications that require provable dependability.\r
+\r
+    1 tab == 4 spaces!\r
+*/\r
+\r
+#ifndef ABORT_DELAY_H\r
+#define ABORT_DELAY_H\r
+\r
+void vCreateAbortDelayTasks( void );\r
+BaseType_t xAreAbortDelayTestTasksStillRunning( void );\r
+\r
+#endif\r
+\r
+\r
diff --git a/FreeRTOS/Demo/Common/include/AltBlckQ.h b/FreeRTOS/Demo/Common/include/AltBlckQ.h
deleted file mode 100644 (file)
index f2ed851..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-#ifndef ALT_BLOCK_Q_H\r
-#define ALT_BLOCK_Q_H\r
-\r
-void vStartAltBlockingQueueTasks( UBaseType_t uxPriority );\r
-BaseType_t xAreAltBlockingQueuesStillRunning( void );\r
-\r
-#endif\r
-\r
-\r
diff --git a/FreeRTOS/Demo/Common/include/AltBlock.h b/FreeRTOS/Demo/Common/include/AltBlock.h
deleted file mode 100644 (file)
index 8a7f729..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-#ifndef FAST_BLOCK_TIME_TEST_H\r
-#define FAST_BLOCK_TIME_TEST_H\r
-\r
-void vCreateAltBlockTimeTasks( void );\r
-BaseType_t xAreAltBlockTimeTestTasksStillRunning( void );\r
-\r
-#endif\r
-\r
-\r
diff --git a/FreeRTOS/Demo/Common/include/AltPollQ.h b/FreeRTOS/Demo/Common/include/AltPollQ.h
deleted file mode 100644 (file)
index 0797f7a..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-#ifndef ALT_POLLED_Q_H\r
-#define ALT_POLLED_Q_H\r
-\r
-void vStartAltPolledQueueTasks( UBaseType_t uxPriority );\r
-BaseType_t xAreAltPollingQueuesStillRunning( void );\r
-\r
-#endif\r
-\r
-\r
diff --git a/FreeRTOS/Demo/Common/include/AltQTest.h b/FreeRTOS/Demo/Common/include/AltQTest.h
deleted file mode 100644 (file)
index 8ee274a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*\r
-    FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd.\r
-    All rights reserved\r
-\r
-    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
-\r
-    This file is part of the FreeRTOS distribution.\r
-\r
-    FreeRTOS is free software; you can redistribute it and/or modify it under\r
-    the terms of the GNU General Public License (version 2) as published by the\r
-    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
-\r
-    ***************************************************************************\r
-    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
-    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
-    >>!   obliged to provide the source code for proprietary components     !<<\r
-    >>!   outside of the FreeRTOS kernel.                                   !<<\r
-    ***************************************************************************\r
-\r
-    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
-    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
-    link: http://www.freertos.org/a00114.html\r
-\r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that is more than just the market leader, it     *\r
-     *    is the industry's de facto standard.                               *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly while simultaneously helping     *\r
-     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
-     *    tutorial book, reference manual, or both:                          *\r
-     *    http://www.FreeRTOS.org/Documentation                              *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
-    the FAQ page "My application does not run, what could be wrong?".  Have you\r
-    defined configASSERT()?\r
-\r
-    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
-    embedded software for free we request you assist our global community by\r
-    participating in the support forum.\r
-\r
-    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
-    be as productive as possible as early as possible.  Now you can receive\r
-    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
-    Ltd, and the world's leading authority on the world's leading RTOS.\r
-\r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
-    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
-\r
-    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
-    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
-    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and commercial middleware.\r
-\r
-    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
-    engineered and independently SIL3 certified version for use in safety and\r
-    mission critical applications that require provable dependability.\r
-\r
-    1 tab == 4 spaces!\r
-*/\r
-\r
-#ifndef FAST_GEN_Q_TEST_H\r
-#define FAST_GEN_Q_TEST_H\r
-\r
-void vStartAltGenericQueueTasks( UBaseType_t uxPriority );\r
-BaseType_t xAreAltGenericQueueTasksStillRunning( void );\r
-\r
-#endif /* GEN_Q_TEST_H */\r
-\r
-\r
-\r
index 6cb7229333c19cc2657c7f8537cbf3c100a088ef..a1a5827eed7c7b501eaa649c06d5490cf1b67e2d 100644 (file)
 #define configUSE_MALLOC_FAILED_HOOK   1\r
 #define configUSE_APPLICATION_TASK_TAG 0\r
 #define configUSE_COUNTING_SEMAPHORES  1\r
-#define configUSE_ALTERNATIVE_API              1\r
+#define configUSE_ALTERNATIVE_API              0\r
 \r
 #define configUSE_TIMERS                               1\r
 #define configTIMER_TASK_PRIORITY              2\r
@@ -134,7 +134,7 @@ to exclude the API function. */
 \r
 /* This demo makes use of one or more example stats formatting functions.  These\r
 format the raw data provided by the xTaskGetSystemState() function in to human\r
-readable ASCII form.  See the notes in the implementation of vTaskList() within \r
+readable ASCII form.  See the notes in the implementation of vTaskList() within\r
 FreeRTOS/Source/tasks.c for limitations. */\r
 #define configINCLUDE_STATS_FORMATTING_FUNCTIONS       1\r
 \r
index 44b08929794542f90532abcf6f780177e90089c6..b542c2a045e08fc0a02e6daee5ff0f2c7f6d493a 100644 (file)
@@ -89,7 +89,7 @@
 #define configUSE_DAEMON_TASK_STARTUP_HOOK             1\r
 #define configTICK_RATE_HZ                                             ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */\r
 #define configMINIMAL_STACK_SIZE                               ( ( unsigned short ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */\r
-#define configTOTAL_HEAP_SIZE                                  ( ( size_t ) ( 24 * 1024 ) )\r
+#define configTOTAL_HEAP_SIZE                                  ( ( size_t ) ( 30 * 1024 ) )\r
 #define configMAX_TASK_NAME_LEN                                        ( 12 )\r
 #define configUSE_TRACE_FACILITY                               1\r
 #define configUSE_16_BIT_TICKS                                 0\r
 #define configUSE_MALLOC_FAILED_HOOK                   1\r
 #define configUSE_APPLICATION_TASK_TAG                 1\r
 #define configUSE_COUNTING_SEMAPHORES                  1\r
-#define configUSE_ALTERNATIVE_API                              1\r
+#define configUSE_ALTERNATIVE_API                              0\r
 #define configUSE_QUEUE_SETS                                   1\r
 #define configUSE_TASK_NOTIFICATIONS                   1\r
 #define configSUPPORT_STATIC_ALLOCATION                        1\r
@@ -150,6 +150,7 @@ functions anyway. */
 #define INCLUDE_eTaskGetState                                  1\r
 #define INCLUDE_xSemaphoreGetMutexHolder               1\r
 #define INCLUDE_xTimerPendFunctionCall                 1\r
+#define INCLUDE_xTaskAbortDelay                                        1\r
 \r
 /* It is a good idea to define configASSERT() while developing.  configASSERT()\r
 uses the same semantics as the standard C assert() macro. */\r
index 7039112bfca16c76535a9c873f55f7abde3ccf34..01c34f938076b685259f9d5dc7d722560404eb29 100644 (file)
  * check the actual usage by selecting View menu -> Trace Details ->\r
  * Resource Usage -> Object Table.\r
  ******************************************************************************/\r
-#define NTask                  100\r
-#define NISR                   60\r
-#define NQueue                 60\r
-#define NSemaphore             60\r
-#define NMutex                 60\r
-#define NTimer                 200\r
-#define NEventGroup            60\r
+#define NTask                  150\r
+#define NISR                   90\r
+#define NQueue                 90\r
+#define NSemaphore             90\r
+#define NMutex                 90\r
+#define NTimer                 300\r
+#define NEventGroup            90\r
 \r
 /******************************************************************************\r
  * INCLUDE_MEMMANG_EVENTS\r
index 3f819af17f355268d8409cac373a4fbb04562061..6afed9a6fc22a0dbdcf20bcac3eba328f049c5fe 100644 (file)
@@ -1,16 +1,21 @@
 ï»¿\r
-Microsoft Visual Studio Solution File, Format Version 11.00\r
-# Visual C++ Express 2010\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WIN32", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio 14\r
+VisualStudioVersion = 14.0.24720.0\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RTOSDemo", "WIN32.vcxproj", "{C686325E-3261-42F7-AEB1-DDE5280E1CEB}"\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
+               Optimised|Win32 = Optimised|Win32\r
                Release|Win32 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
                {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Debug|Win32.Build.0 = Debug|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Optimised|Win32.ActiveCfg = Optimised|Win32\r
+               {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Optimised|Win32.Build.0 = Optimised|Win32\r
                {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.ActiveCfg = Release|Win32\r
                {C686325E-3261-42F7-AEB1-DDE5280E1CEB}.Release|Win32.Build.0 = Release|Win32\r
        EndGlobalSection\r
index 5349d5037d36e0033141b689a8cf89ef655f446d..67409518edd14cd5105f884af79a0e06754e8b2c 100644 (file)
@@ -1,10 +1,14 @@
 ï»¿<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
   <ItemGroup Label="ProjectConfigurations">\r
     <ProjectConfiguration Include="Debug|Win32">\r
       <Configuration>Debug</Configuration>\r
       <Platform>Win32</Platform>\r
     </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Optimised|Win32">\r
+      <Configuration>Optimised</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
     <ProjectConfiguration Include="Release|Win32">\r
       <Configuration>Release</Configuration>\r
       <Platform>Win32</Platform>\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v140</PlatformToolset>\r
   </PropertyGroup>\r
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
     <ConfigurationType>Application</ConfigurationType>\r
     <UseOfMfc>false</UseOfMfc>\r
     <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+    <PlatformToolset>v140</PlatformToolset>\r
   </PropertyGroup>\r
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
   <ImportGroup Label="ExtensionSettings">\r
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
     <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
   </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
   <PropertyGroup Label="UserMacros" />\r
   <PropertyGroup>\r
     <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</OutDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">.\Debug\</OutDir>\r
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\</IntDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">.\Debug\</IntDir>\r
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">true</LinkIncremental>\r
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</OutDir>\r
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\</IntDir>\r
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
       <SubSystem>Console</SubSystem>\r
       <TargetMachine>MachineX86</TargetMachine>\r
       <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\Debug/WIN32.bsc</OutputFile>\r
+    </Bscmake>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">\r
+    <Midl>\r
+      <TypeLibraryName>.\Debug/WIN32.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Full</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;..\..\..\FreeRTOS-Plus\Source\FreeRTOS-Plus-Trace\Include;.\Trace_Recorder_Configuration;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeaderOutputFile>.\Debug/WIN32.pch</PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+      <DisableLanguageExtensions>false</DisableLanguageExtensions>\r
+      <AdditionalOptions>/wd4210 %(AdditionalOptions)</AdditionalOptions>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0c09</Culture>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <OutputFile>.\Debug/RTOSDemo.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>.\Debug/WIN32.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>\r
     </Link>\r
     <Bscmake>\r
       <SuppressStartupBanner>true</SuppressStartupBanner>\r
     <ClCompile Include="..\..\Source\event_groups.c" />\r
     <ClCompile Include="..\..\Source\portable\MemMang\heap_5.c" />\r
     <ClCompile Include="..\..\Source\timers.c" />\r
+    <ClCompile Include="..\Common\Minimal\AbortDelay.c" />\r
     <ClCompile Include="..\Common\Minimal\BlockQ.c" />\r
     <ClCompile Include="..\Common\Minimal\blocktim.c" />\r
     <ClCompile Include="..\Common\Minimal\countsem.c" />\r
     <ClCompile Include="..\Common\Minimal\timerdemo.c" />\r
     <ClCompile Include="main.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <ClCompile Include="..\..\Source\list.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <ClCompile Include="..\..\Source\portable\MSVC-MingW\port.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <ClCompile Include="..\..\Source\queue.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <ClCompile Include="..\..\Source\tasks.c">\r
       <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Optimised|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
       <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <ClCompile Include="main_blinky.c" />\r
index f9181f51040e840ec0e4b9a5e024f4a324329f93..3be3db638bc673262edabb5d36e9a5def5cf7d48 100644 (file)
     <ClCompile Include="..\Common\Minimal\StaticAllocation.c">\r
       <Filter>Demo App Source\Full_Demo\Common Demo Tasks</Filter>\r
     </ClCompile>\r
+    <ClCompile Include="..\Common\Minimal\AbortDelay.c">\r
+      <Filter>Demo App Source\Full_Demo\Common Demo Tasks</Filter>\r
+    </ClCompile>\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="FreeRTOSConfig.h">\r
index 44a935539277c97434e80dff9065e6b08c05f89d..14263318c660c89be2f528b3665c8edf7260f181 100644 (file)
@@ -118,9 +118,9 @@ that make up the total heap.  heap_5 is only used for test and example purposes
 as this demo could easily create one large heap region instead of multiple\r
 smaller heap regions - in which case heap_4.c would be the more appropriate\r
 choice.  See http://www.freertos.org/a00111.html for an explanation. */\r
-#define mainREGION_1_SIZE      4001\r
+#define mainREGION_1_SIZE      7001\r
 #define mainREGION_2_SIZE      18105\r
-#define mainREGION_3_SIZE      1807\r
+#define mainREGION_3_SIZE      2807\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -175,7 +175,7 @@ StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];
 /* The user trace event posted to the trace recording on each tick interrupt.\r
 Note:  This project runs under Windows, and Windows will not be executing the\r
 RTOS threads continuously.  Therefore tick events will not appear with a regular\r
-interval within the the trace recording. */\r
+interval within the trace recording. */\r
 traceLabel xTickTraceUserEvent;\r
 static portBASE_TYPE xTraceRunning = pdTRUE;\r
 \r
index d01969926523604c74107dbc09086b62e38d2a87..86c866c17e884975e1be76c909c5365168460178 100644 (file)
 #include "TaskNotify.h"\r
 #include "QueueSetPolling.h"\r
 #include "StaticAllocation.h"\r
+#include "blocktim.h"\r
+#include "AbortDelay.h"\r
 \r
 /* Priorities at which the tasks are created. */\r
 #define mainCHECK_TASK_PRIORITY                        ( configMAX_PRIORITIES - 2 )\r
@@ -181,6 +183,12 @@ static void prvPendedFunction( void *pvParameter1, uint32_t ulParameter2 );
  */\r
 static void prvDemoQueueSpaceFunctions( void *pvParameters );\r
 \r
+/*\r
+ * Tasks that ensure indefinite delays are truly indefinite.\r
+ */\r
+static void prvPermanentlyBlockingSemaphoreTask( void *pvParameters );\r
+static void prvPermanentlyBlockingNotificationTask( void *pvParameters );\r
+\r
 /*-----------------------------------------------------------*/\r
 \r
 /* The variable into which error messages are latched. */\r
@@ -214,7 +222,11 @@ int main_full( void )
        vStartEventGroupTasks();\r
        vStartInterruptSemaphoreTasks();\r
        vStartQueueSetPollingTask();\r
+       vCreateBlockTimeTasks();\r
+       vCreateAbortDelayTasks();\r
        xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+       xTaskCreate( prvPermanentlyBlockingSemaphoreTask, "BlockSem", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+       xTaskCreate( prvPermanentlyBlockingNotificationTask, "BlockNoti", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
 \r
        #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
        {\r
@@ -242,9 +254,9 @@ int main_full( void )
        /* Start the scheduler itself. */\r
        vTaskStartScheduler();\r
 \r
-    /* Should never get here unless there was not enough heap space to create\r
+       /* Should never get here unless there was not enough heap space to create\r
        the idle and other system tasks. */\r
-    return 0;\r
+       return 0;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -344,6 +356,14 @@ const TickType_t xCycleFrequency = pdMS_TO_TICKS( 2500UL );
                {\r
                        pcStatusMessage = "Error: Queue set polling";\r
                }\r
+               else if( xAreBlockTimeTestTasksStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Block time";\r
+               }\r
+               else if( xAreAbortDelayTestTasksStillRunning() != pdPASS )\r
+               {\r
+                       pcStatusMessage = "Error: Abort delay";\r
+               }\r
 \r
                #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
                        else if( xAreStaticAllocationTasksStillRunning() != pdPASS )\r
@@ -671,5 +691,35 @@ unsigned portBASE_TYPE uxReturn, x;
                #endif\r
        }\r
 }\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvPermanentlyBlockingSemaphoreTask( void *pvParameters )\r
+{\r
+SemaphoreHandle_t xSemaphore;\r
+\r
+       /* This task should block on a semaphore, and never return. */\r
+       xSemaphore = xSemaphoreCreateBinary();\r
+       configASSERT( xSemaphore );\r
+\r
+       xSemaphoreTake( xSemaphore, portMAX_DELAY );\r
+\r
+       /* The above xSemaphoreTake() call should never return, force an assert if\r
+       it does. */\r
+       configASSERT( pvParameters != NULL );\r
+       vTaskDelete( NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvPermanentlyBlockingNotificationTask( void *pvParameters )\r
+{\r
+       /* This task should block on a task notification, and never return. */\r
+       ulTaskNotifyTake( pdTRUE, portMAX_DELAY );\r
+\r
+       /* The above ulTaskNotifyTake() call should never return, force an assert\r
+       if it does. */\r
+       configASSERT( pvParameters != NULL );\r
+       vTaskDelete( NULL );\r
+}\r
+\r
 \r
 \r
index c6a2a58bce24f57ee8b5346b9ada92fe1b49217f..1f396103bb8a0bd614f4fc17bbb806245ee1f715 100644 (file)
@@ -99,7 +99,7 @@
 #define configUSE_MALLOC_FAILED_HOOK                   1\r
 #define configUSE_APPLICATION_TASK_TAG                 1\r
 #define configUSE_COUNTING_SEMAPHORES                  1\r
-#define configUSE_ALTERNATIVE_API                              1\r
+#define configUSE_ALTERNATIVE_API                              0\r
 #define configUSE_QUEUE_SETS                                   1\r
 #define configUSE_TASK_NOTIFICATIONS                   1\r
 \r
index 78380c7372defb5c753ad0e745730c363fc6515d..891be66db75bc0c4e7e5dca4d6471c2804a1ad90 100644 (file)
@@ -126,7 +126,7 @@ typedef struct xEventGroupDefinition
  * wait condition is met if any of the bits set in uxBitsToWait for are also set\r
  * in uxCurrentEventBits.\r
  */\r
-static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits );\r
+static BaseType_t prvTestWaitCondition( const EventBits_t uxCurrentEventBits, const EventBits_t uxBitsToWaitFor, const BaseType_t xWaitForAllBits ) PRIVILEGED_FUNCTION;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
index 55306add005b84923d8d9549d862a25d7014f824..f43d6f9c5cd8ad4b2373a1053f566aed3753c530 100644 (file)
@@ -839,6 +839,10 @@ V8 if desired. */
        #define xList List_t\r
 #endif /* configENABLE_BACKWARD_COMPATIBILITY */\r
 \r
+#if( configUSE_ALTERNATIVE_API != 0 )\r
+       #error The alternative API was deprecated some time ago, and was removed in FreeRTOS V9.0 0\r
+#endif\r
+\r
 /* Set configUSE_TASK_FPU_SUPPORT to 0 to omit floating point support even\r
 if floating point hardware is otherwise supported by the FreeRTOS port in use.\r
 This constant is not supported by all FreeRTOS ports that include floating\r
index 46a16bdead4c2ace63d6541f38b41c3718a82f6b..647ed5817aeb987a47bc9a87fc20a67687318747 100644 (file)
@@ -725,7 +725,7 @@ void vEventGroupClearBitsCallback( void *pvEventGroup, const uint32_t ulBitsToCl
  * Generic version of the event group creation function, which is in turn called\r
  * by the event group creation macros.\r
  */\r
-EventGroupHandle_t xEventGroupGenericCreate( StaticEventGroup_t *pxStaticEventGroup );\r
+EventGroupHandle_t xEventGroupGenericCreate( StaticEventGroup_t *pxStaticEventGroup ) PRIVILEGED_FUNCTION;\r
 \r
 #if (configUSE_TRACE_FACILITY == 1)\r
        UBaseType_t uxEventGroupGetNumber( void* xEventGroup ) PRIVILEGED_FUNCTION;\r
index 5b2ad474d848a7d690dc14dacb2edbe61b9d66c6..2d211ba625f9c24371221dfe4076c09ce3e14ba7 100644 (file)
@@ -113,8 +113,6 @@ only for ports that are using the MPU. */
                #define xQueueTakeMutexRecursive                MPU_xQueueTakeMutexRecursive\r
                #define xQueueCreateCountingSemaphore   MPU_xQueueCreateCountingSemaphore\r
                #define xQueueGenericSend                               MPU_xQueueGenericSend\r
-               #define xQueueAltGenericSend                    MPU_xQueueAltGenericSend\r
-               #define xQueueAltGenericReceive                 MPU_xQueueAltGenericReceive\r
                #define xQueueGenericReceive                    MPU_xQueueGenericReceive\r
                #define uxQueueMessagesWaiting                  MPU_uxQueueMessagesWaiting\r
                #define vQueueDelete                                    MPU_vQueueDelete\r
@@ -124,7 +122,6 @@ only for ports that are using the MPU. */
                #define xQueueAddToSet                                  MPU_xQueueAddToSet\r
                #define xQueueRemoveFromSet                             MPU_xQueueRemoveFromSet\r
                #define xQueueGetMutexHolder                    MPU_xQueueGetMutexHolder\r
-               #define xQueueGetMutexHolder                    MPU_xQueueGetMutexHolder\r
 \r
                #define pvPortMalloc                                    MPU_pvPortMalloc\r
                #define vPortFree                                               MPU_vPortFree\r
index aa15e325f1f363ea197ddecfd8287ba5dc98679a..c4d7db8f5fd584b3d4be94459535d002306bf604 100644 (file)
@@ -1543,28 +1543,6 @@ BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FU
 BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;\r
 UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;\r
 \r
-\r
-/*\r
- * xQueueAltGenericSend() is an alternative version of xQueueGenericSend().\r
- * Likewise xQueueAltGenericReceive() is an alternative version of\r
- * xQueueGenericReceive().\r
- *\r
- * The source code that implements the alternative (Alt) API is much\r
- * simpler     because it executes everything from within a critical section.\r
- * This is     the approach taken by many other RTOSes, but FreeRTOS.org has the\r
- * preferred fully featured API too.  The fully featured API has more\r
- * complex     code that takes longer to execute, but makes much less use of\r
- * critical sections.  Therefore the alternative API sacrifices interrupt\r
- * responsiveness to gain execution speed, whereas the fully featured API\r
- * sacrifices execution speed to ensure better interrupt responsiveness.\r
- */\r
-BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;\r
-BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking ) PRIVILEGED_FUNCTION;\r
-#define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )\r
-#define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )\r
-#define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )\r
-#define xQueueAltPeek( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdTRUE )\r
-\r
 /*\r
  * The functions defined above are for passing data to and from tasks.  The\r
  * functions below are the equivalents for passing data to and from\r
@@ -1653,7 +1631,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION
  * returned.\r
  */\r
 #if( configQUEUE_REGISTRY_SIZE > 0 )\r
-       const char *pcQueueGetQueueName( QueueHandle_t xQueue ); /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
+       const char *pcQueueGetQueueName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 #endif\r
 \r
 /*\r
index fe31007c7a86a3fa6da8dfa1e1315f4ff54210ad..693437ed60545c265bddc997e2e3c07d28216cfe 100644 (file)
@@ -430,21 +430,6 @@ typedef QueueHandle_t SemaphoreHandle_t;
  */\r
 #define xSemaphoreTakeRecursive( xMutex, xBlockTime )  xQueueTakeMutexRecursive( ( xMutex ), ( xBlockTime ) )\r
 \r
-\r
-/*\r
- * xSemaphoreAltTake() is an alternative version of xSemaphoreTake().\r
- *\r
- * The source code that implements the alternative (Alt) API is much\r
- * simpler     because it executes everything from within a critical section.\r
- * This is     the approach taken by many other RTOSes, but FreeRTOS.org has the\r
- * preferred fully featured API too.  The fully featured API has more\r
- * complex     code that takes longer to execute, but makes much less use of\r
- * critical sections.  Therefore the alternative API sacrifices interrupt\r
- * responsiveness to gain execution speed, whereas the fully featured API\r
- * sacrifices execution speed to ensure better interrupt responsiveness.\r
- */\r
-#define xSemaphoreAltTake( xSemaphore, xBlockTime )            xQueueAltGenericReceive( ( QueueHandle_t ) ( xSemaphore ), NULL, ( xBlockTime ), pdFALSE )\r
-\r
 /**\r
  * semphr. h\r
  * <pre>xSemaphoreGive( SemaphoreHandle_t xSemaphore )</pre>\r
@@ -592,20 +577,6 @@ typedef QueueHandle_t SemaphoreHandle_t;
  */\r
 #define xSemaphoreGiveRecursive( xMutex )      xQueueGiveMutexRecursive( ( xMutex ) )\r
 \r
-/*\r
- * xSemaphoreAltGive() is an alternative version of xSemaphoreGive().\r
- *\r
- * The source code that implements the alternative (Alt) API is much\r
- * simpler     because it executes everything from within a critical section.\r
- * This is     the approach taken by many other RTOSes, but FreeRTOS.org has the\r
- * preferred fully featured API too.  The fully featured API has more\r
- * complex     code that takes longer to execute, but makes much less use of\r
- * critical sections.  Therefore the alternative API sacrifices interrupt\r
- * responsiveness to gain execution speed, whereas the fully featured API\r
- * sacrifices execution speed to ensure better interrupt responsiveness.\r
- */\r
-#define xSemaphoreAltGive( xSemaphore )                xQueueAltGenericSend( ( QueueHandle_t ) ( xSemaphore ), NULL, semGIVE_BLOCK_TIME, queueSEND_TO_BACK )\r
-\r
 /**\r
  * semphr. h\r
  * <pre>\r
index df352eb95eee08ae481d4abe4babc7b63f2342c9..97969ab42afe5a73038ded3bf98436329a80b5fc 100644 (file)
@@ -767,7 +767,7 @@ void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xT
  * \defgroup xTaskAbortDelay xTaskAbortDelay\r
  * \ingroup TaskCtrl\r
  */\r
-BaseType_t xTaskAbortDelay( TaskHandle_t xTask );\r
+BaseType_t xTaskAbortDelay( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
@@ -896,7 +896,7 @@ eTaskState eTaskGetState( TaskHandle_t xTask ) PRIVILEGED_FUNCTION;
  * \defgroup vTaskGetTaskInfo vTaskGetTaskInfo\r
  * \ingroup TaskCtrl\r
  */\r
-void vTaskGetTaskInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );\r
+void vTaskGetTaskInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState ) PRIVILEGED_FUNCTION;\r
 \r
 /**\r
  * task. h\r
index 9f5169bc2a525f74f5ffcfdf6e4acf2d0bdab431..18876d28f263cc9ea34632908f1b25d6381dc917 100644 (file)
@@ -518,7 +518,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index 4d3232aecd89749ae1600caa23a8c53bc0d7f3ee..f8c889ec7a7894a3542e9d8335e076e97bff7f3c 100644 (file)
@@ -182,7 +182,7 @@ void vPortTaskUsesFPU( void );
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __builtin_clz( uxReadyPriorities ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - __builtin_clz( uxReadyPriorities ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r
index 1bd15cd137b8fd3875583d54ce2016ef79a1d7af..d8fcb321e38a291ffc235c562771e837e2cb809b 100644 (file)
@@ -624,7 +624,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index a8ebb722cf75be9d84813a81d5c9e1fe239d8a36..292cfd0ad8319bac914a48ab9508a1bb10787a2f 100644 (file)
@@ -181,7 +181,7 @@ not necessary for to use this port.  They are defined so the common demo files
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r
index 15de32e9c9d306ad5e02a73a3b11764f16d17b00..bf87d87dc0de1aa77db6bc16585807e5550d79c7 100644 (file)
@@ -207,8 +207,6 @@ QueueHandle_t MPU_xQueueCreateMutex( void );
 QueueHandle_t MPU_xQueueCreateCountingSemaphore( UBaseType_t uxCountValue, UBaseType_t uxInitialCount );\r
 BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime );\r
 BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t xMutex );\r
-BaseType_t MPU_xQueueAltGenericSend( QueueHandle_t pxQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition );\r
-BaseType_t MPU_xQueueAltGenericReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking );\r
 void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName );\r
 void MPU_vQueueDelete( QueueHandle_t xQueue );\r
 void *MPU_pvPortMalloc( size_t xSize );\r
@@ -1136,32 +1134,6 @@ void * xReturn;
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if configUSE_ALTERNATIVE_API == 1\r
-       BaseType_t MPU_xQueueAltGenericSend( QueueHandle_t pxQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition )\r
-       {\r
-       BaseType_t xReturn;\r
-       BaseType_t xRunningPrivileged = prvRaisePrivilege();\r
-\r
-               xReturn =       BaseType_t xQueueAltGenericSend( pxQueue, pvItemToQueue, xTicksToWait, xCopyPosition );\r
-               portRESET_PRIVILEGE( xRunningPrivileged );\r
-               return xReturn;\r
-       }\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
-#if configUSE_ALTERNATIVE_API == 1\r
-       BaseType_t MPU_xQueueAltGenericReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )\r
-       {\r
-    BaseType_t xReturn;\r
-       BaseType_t xRunningPrivileged = prvRaisePrivilege();\r
-\r
-               xReturn = xQueueAltGenericReceive( pxQueue, pvBuffer, xTicksToWait, xJustPeeking );\r
-               portRESET_PRIVILEGE( xRunningPrivileged );\r
-               return xReturn;\r
-       }\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
 #if configQUEUE_REGISTRY_SIZE > 0\r
        void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName )\r
        {\r
index 4732d98e0aff72db19564d09fc0fdeb93c57251e..daf1fd42f65eaf85c842be8549f45b14a45f91f1 100644 (file)
@@ -279,7 +279,7 @@ void vPortSVCHandler( void )
                                        "       msr     basepri, r0                                     \n"\r
                                        "       bx r14                                                  \n"\r
                                        "                                                                       \n"\r
-                                       "       .align 2                                                \n"\r
+                                       "       .align 4                                                \n"\r
                                        "pxCurrentTCBConst2: .word pxCurrentTCB                         \n"\r
                                );\r
 }\r
@@ -479,7 +479,7 @@ void xPortPendSVHandler( void )
        "                                                                               \n"\r
        "       bx r14                                                          \n"\r
        "                                                                               \n"\r
-       "       .align 2                                                        \n"\r
+       "       .align 4                                                        \n"\r
        "pxCurrentTCBConst: .word pxCurrentTCB  \n"\r
        ::"i"(configMAX_SYSCALL_INTERRUPT_PRIORITY)\r
        );\r
@@ -492,7 +492,7 @@ void xPortSysTickHandler( void )
        executes all interrupts must be unmasked.  There is therefore no need to\r
        save and then restore the interrupt mask value as its value is already\r
        known. */\r
-       ( void ) portSET_INTERRUPT_MASK_FROM_ISR();\r
+       portDISABLE_INTERRUPTS();\r
        {\r
                /* Increment the RTOS tick. */\r
                if( xTaskIncrementTick() != pdFALSE )\r
@@ -502,7 +502,7 @@ void xPortSysTickHandler( void )
                        portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
                }\r
        }\r
-       portCLEAR_INTERRUPT_MASK_FROM_ISR( 0 );\r
+       portENABLE_INTERRUPTS();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -636,7 +636,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index 2754972fd02ce2cfe96841c6da8318c2786217ba..25992d481c60d6dd44427288a12f10bd92ef78cb 100644 (file)
@@ -188,7 +188,7 @@ not necessary for to use this port.  They are defined so the common demo files
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r
index 6845a8d3b3f3ebe7ed1ef3c05a6a6697aab9bb05..11c27a2086aafb758ed3a2806755bde54822131c 100644 (file)
@@ -626,7 +626,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index 11fad494c12910dd7b52c4ddeb3da5bcf3530c73..e1e4c5a1efc2c72f74f635a5bc60bb7bdb67b873 100644 (file)
@@ -188,7 +188,7 @@ not necessary for to use this port.  They are defined so the common demo files
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r
index 159b51a44a459a84ac2fdfdd79e8103875f68529..ed9b00e7ac895aced6e0f1cedda99277ba8a0b21 100644 (file)
@@ -619,14 +619,14 @@ volatile uint32_t ulErrorStatus = 0;
        {\r
        BaseType_t xReturn;\r
 \r
-               if( prvCheckValidityOfVectorNumber( ulVectorNumber ) != pdFAIL )\r
+               xReturn = prvCheckValidityOfVectorNumber( ulVectorNumber );\r
+\r
+               if( xReturn != pdFAIL )\r
                {\r
                        /* Save the handler passed in by the application in the vector number\r
                        passed in.  The addresses are then called from the central interrupt\r
                        handler. */\r
                        xInterruptHandlerTable[ ulVectorNumber ] = pxHandler;\r
-\r
-                       xReturn = pdPASS;\r
                }\r
 \r
                return xReturn;\r
@@ -639,7 +639,9 @@ BaseType_t xPortInstallInterruptHandler( ISR_Handler_t pxHandler, uint32_t ulVec
 {\r
 BaseType_t xReturn;\r
 \r
-       if( prvCheckValidityOfVectorNumber( ulVectorNumber ) != pdFAIL )\r
+       xReturn = prvCheckValidityOfVectorNumber( ulVectorNumber );\r
+       \r
+       if( xReturn != pdFAIL )\r
        {\r
                taskENTER_CRITICAL();\r
                {\r
@@ -647,8 +649,6 @@ BaseType_t xReturn;
                        prvSetInterruptGate( ( uint8_t ) ulVectorNumber, ( ISR_Handler_t ) pxHandler, portIDT_FLAGS );\r
                }\r
                taskEXIT_CRITICAL();\r
-\r
-               xReturn = pdPASS;\r
        }\r
 \r
        return xReturn;\r
index e91dcd8bb8f4eab4d2efac9d5ca0c6bf1322cba6..af989be21213dc4b426fa73a4d08af76b97c1dc6 100644 (file)
@@ -180,7 +180,7 @@ extern volatile uint32_t ulTaskSwitchRequested;
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) ucPortCountLeadingZeros( ( uxReadyPriorities ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r
index f9f61b5f89e8631dc3f2633e2f8bcb78feecd071..611edd03cedd7736231d20753c8ae3459b5bfeb4 100644 (file)
@@ -505,7 +505,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index ea600979685c33d5c5d48967cd864a348135e080..b9515ff1a8970bd5c6f4708eea2fc30b2ecc485e 100644 (file)
@@ -145,7 +145,7 @@ extern void vPortYield( void );
        /*-----------------------------------------------------------*/\r
 \r
        #include <intrinsics.h>\r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __CLZ( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( ( uint32_t ) __CLZ( ( uxReadyPriorities ) ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 /*-----------------------------------------------------------*/\r
index bfacbd186e3713ab8039d0630de315fdcb5e8c13..dfc9947ccbd9f91b34fd0be52998196972a500dd 100644 (file)
@@ -533,7 +533,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index f202bb68b42422229a5f71d03b7c7395729471f1..bb6664701bd6bbf1b23b304fee3f21b9372524dd 100644 (file)
@@ -151,7 +151,7 @@ typedef unsigned long UBaseType_t;
        /*-----------------------------------------------------------*/\r
 \r
        #include <intrinsics.h>\r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - __CLZ( ( uxReadyPriorities ) ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( ( uint32_t ) __CLZ( ( uxReadyPriorities ) ) ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 /*-----------------------------------------------------------*/\r
index 828bb75b1396a72fc73007e048ae4e84adc4f50d..c635752488e3bca5357e6707dc807f0ea6e2f222 100644 (file)
@@ -517,7 +517,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index 4ad6df9214cf434f04207022d695178f4ce46db9..731e178223408660f34bfd74d6fcc4deff02c57f 100644 (file)
@@ -226,8 +226,8 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
 \r
        *pxTopOfStack = (StackType_t) pxCode;           /* CP0_EPC */\r
        pxTopOfStack--;\r
-    \r
-       *pxTopOfStack = (StackType_t) 0x00000000;       /* DSPControl */    \r
+\r
+       *pxTopOfStack = (StackType_t) 0x00000000;       /* DSPControl */\r
        pxTopOfStack -= 7;                                              /* Includes space for AC1 - AC3. */\r
 \r
        *pxTopOfStack = (StackType_t) portTASK_RETURN_ADDRESS;  /* ra */\r
@@ -237,7 +237,7 @@ StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t px
        pxTopOfStack -= 15;\r
 \r
        *pxTopOfStack = (StackType_t) pdFALSE; /*by default disable FPU context save on parts with FPU */\r
-    \r
+\r
        return pxTopOfStack;\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -267,7 +267,7 @@ static void prvTaskExitError( void )
  */\r
 __attribute__(( weak )) void vApplicationSetupTickTimerInterrupt( void )\r
 {\r
-const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1;\r
+const uint32_t ulCompareMatch = ( (configPERIPHERAL_CLOCK_HZ / portTIMER_PRESCALE) / configTICK_RATE_HZ ) - 1UL;\r
 \r
        T1CON = 0x0000;\r
        T1CONbits.TCKPS = portPRESCALE_BITS;\r
@@ -388,14 +388,14 @@ void vPortClearInterruptMaskFromISR( UBaseType_t uxSavedStatusRegister )
        extern void vPortInitialiseFPSCR( uint32_t uxFPSCRInit );\r
 \r
                portENTER_CRITICAL();\r
-    \r
+\r
                /* Initialise the floating point status register. */\r
-               vPortInitialiseFPSCR(portINITIAL_FPSCR);  \r
-    \r
+               vPortInitialiseFPSCR(portINITIAL_FPSCR);\r
+\r
                /* A task is registering the fact that it needs a FPU context. Set the\r
                FPU flag (saved as part of the task context). */\r
                ulTaskHasFPUContext = pdTRUE;\r
-    \r
+\r
                portEXIT_CRITICAL();\r
        }\r
 \r
index 64c773ef10909ad6b7cff91cae4301d0b6588f03..5ff8a52daac468102cadb3f85e63b90967c06d8d 100644 (file)
 #define portMAX_INTERRUPTS                             ( ( uint32_t ) sizeof( uint32_t ) * 8UL ) /* The number of bits in an uint32_t. */\r
 #define portNO_CRITICAL_NESTING                ( ( uint32_t ) 0 )\r
 \r
+/* The priorities at which the various components of the simulation execute.\r
+Priorities are higher when a soak test is performed to lessen the effect of\r
+Windows interfering with the timing. */\r
+#define portSOAK_TEST\r
+#ifndef portSOAK_TEST\r
+       #define portSIMULATED_INTERRUPTS_THREAD_PRIORITY THREAD_PRIORITY_NORMAL\r
+       #define portSIMULATED_TIMER_THREAD_PRIORITY              THREAD_PRIORITY_BELOW_NORMAL\r
+       #define portTASK_THREAD_PRIORITY                                 THREAD_PRIORITY_IDLE\r
+#else\r
+       #define portSIMULATED_INTERRUPTS_THREAD_PRIORITY THREAD_PRIORITY_TIME_CRITICAL\r
+       #define portSIMULATED_TIMER_THREAD_PRIORITY              THREAD_PRIORITY_HIGHEST\r
+       #define portTASK_THREAD_PRIORITY                                 THREAD_PRIORITY_ABOVE_NORMAL\r
+#endif\r
 /*\r
  * Created as a high priority thread, this function uses a timer to simulate\r
  * a tick interrupt being generated on an embedded target.  In this Windows\r
@@ -261,7 +274,7 @@ int8_t *pcTopOfStack = ( int8_t * ) pxTopOfStack;
        configASSERT( pxThreadState->pvThread );\r
        SetThreadAffinityMask( pxThreadState->pvThread, 0x01 );\r
        SetThreadPriorityBoost( pxThreadState->pvThread, TRUE );\r
-       SetThreadPriority( pxThreadState->pvThread, THREAD_PRIORITY_IDLE );\r
+       SetThreadPriority( pxThreadState->pvThread, portTASK_THREAD_PRIORITY );\r
 \r
        return ( StackType_t * ) pxThreadState;\r
 }\r
@@ -298,7 +311,7 @@ xThreadState *pxThreadState;
 \r
        if( lSuccess == pdPASS )\r
        {\r
-               if( SetThreadPriority( pvHandle, THREAD_PRIORITY_NORMAL ) == 0 )\r
+               if( SetThreadPriority( pvHandle, portSIMULATED_INTERRUPTS_THREAD_PRIORITY ) == 0 )\r
                {\r
                        lSuccess = pdFAIL;\r
                }\r
@@ -315,7 +328,7 @@ xThreadState *pxThreadState;
                pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, CREATE_SUSPENDED, NULL );\r
                if( pvHandle != NULL )\r
                {\r
-                       SetThreadPriority( pvHandle, THREAD_PRIORITY_BELOW_NORMAL );\r
+                       SetThreadPriority( pvHandle, portSIMULATED_TIMER_THREAD_PRIORITY );\r
                        SetThreadPriorityBoost( pvHandle, TRUE );\r
                        SetThreadAffinityMask( pvHandle, 0x01 );\r
                        ResumeThread( pvHandle );\r
@@ -427,8 +440,8 @@ CONTEXT xContext;
                                pxThreadState = ( xThreadState *) *( ( size_t * ) pvOldCurrentTCB );\r
                                SuspendThread( pxThreadState->pvThread );\r
 \r
-                               /* Ensure the thread is actually suspended by performing a \r
-                               synchronous operation that can only complete when the thread is \r
+                               /* Ensure the thread is actually suspended by performing a\r
+                               synchronous operation that can only complete when the thread is\r
                                actually suspended.  The below code asks for dummy register\r
                                data. */\r
                                xContext.ContextFlags = CONTEXT_INTEGER;\r
@@ -493,7 +506,7 @@ uint32_t ulErrorCode;
        does not run and swap it out before it is closed.  If that were to happen\r
        the thread would never run again and effectively be a thread handle and\r
        memory leak. */\r
-       SetThreadPriority( pvThread, THREAD_PRIORITY_ABOVE_NORMAL );\r
+       SetThreadPriority( pvThread, THREAD_PRIORITY_HIGHEST );\r
 \r
        /* This function will not return, therefore a yield is set as pending to\r
        ensure a context switch occurs away from this thread on the next tick. */\r
@@ -524,13 +537,15 @@ void vPortGenerateSimulatedInterrupt( uint32_t ulInterruptNumber )
 \r
        if( ( ulInterruptNumber < portMAX_INTERRUPTS ) && ( pvInterruptEventMutex != NULL ) )\r
        {\r
-               /* Yield interrupts are processed even when critical nesting is non-zero. */\r
+               /* Yield interrupts are processed even when critical nesting is\r
+               non-zero. */\r
                WaitForSingleObject( pvInterruptEventMutex, INFINITE );\r
                ulPendingInterrupts |= ( 1 << ulInterruptNumber );\r
 \r
-               /* The simulated interrupt is now held pending, but don't actually process it\r
-               yet if this call is within a critical section.  It is possible for this to\r
-               be in a critical section as calls to wait for mutexes are accumulative. */\r
+               /* The simulated interrupt is now held pending, but don't actually\r
+               process it yet if this call is within a critical section.  It is\r
+               possible for this to be in a critical section as calls to wait for\r
+               mutexes are accumulative. */\r
                if( ulCriticalNesting == 0 )\r
                {\r
                        SetEvent( pvInterruptEvent );\r
index 2c71d18dd328d95f0b6e9fa91ae269f204b6d151..331fe7954dcdd580fb5baab2fa6ff15498a2f0ff 100644 (file)
@@ -589,7 +589,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index e17a85ed5ff6998c8a2ea1de67dc92571fc204fd..8a160b483690f09360d730f697dd6b6aa7117d35 100644 (file)
@@ -648,7 +648,7 @@ void xPortSysTickHandler( void )
 \r
                                /* The reload value is set to whatever fraction of a single tick\r
                                period remains. */\r
-                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1 ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
+                               portNVIC_SYSTICK_LOAD_REG = ( ( ulCompleteTickPeriods + 1UL ) * ulTimerCountsForOneTick ) - ulCompletedSysTickDecrements;\r
                        }\r
 \r
                        /* Restart SysTick so it runs from portNVIC_SYSTICK_LOAD_REG\r
index 3a6aea92a155fb7d211d48690a8770898fda50a8..ed3d29d23aae7a34815fcf9724f8656cb9a9eaca 100644 (file)
@@ -248,7 +248,7 @@ static void prvCopyDataFromQueue( Queue_t * const pxQueue, void * const pvBuffer
  * structure will be allocated dynamically, otherwise the buffer pointed to by\r
  * pxStaticQueue will be used.\r
  */\r
-static Queue_t *prvAllocateQueueMemory( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t **ppucQueueStorage, StaticQueue_t *pxStaticQueue );\r
+static Queue_t *prvAllocateQueueMemory( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t **ppucQueueStorage, StaticQueue_t *pxStaticQueue ) PRIVILEGED_FUNCTION;\r
 \r
 #if ( configUSE_QUEUE_SETS == 1 )\r
        /*\r
@@ -894,251 +894,6 @@ Queue_t * const pxQueue = ( Queue_t * ) xQueue;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_ALTERNATIVE_API == 1 )\r
-\r
-       BaseType_t xQueueAltGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition )\r
-       {\r
-       BaseType_t xEntryTimeSet = pdFALSE;\r
-       TimeOut_t xTimeOut;\r
-       Queue_t * const pxQueue = ( Queue_t * ) xQueue;\r
-\r
-               configASSERT( pxQueue );\r
-               configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );\r
-\r
-               for( ;; )\r
-               {\r
-                       taskENTER_CRITICAL();\r
-                       {\r
-                               /* Is there room on the queue now?  To be running we must be\r
-                               the highest priority task wanting to access the queue. */\r
-                               if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )\r
-                               {\r
-                                       traceQUEUE_SEND( pxQueue );\r
-                                       prvCopyDataToQueue( pxQueue, pvItemToQueue, xCopyPosition );\r
-\r
-                                       /* If there was a task waiting for data to arrive on the\r
-                                       queue then unblock it now. */\r
-                                       if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )\r
-                                       {\r
-                                               if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
-                                               {\r
-                                                       /* The unblocked task has a priority higher than\r
-                                                       our own so yield immediately. */\r
-                                                       portYIELD_WITHIN_API();\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       mtCOVERAGE_TEST_MARKER();\r
-                                               }\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               mtCOVERAGE_TEST_MARKER();\r
-                                       }\r
-\r
-                                       taskEXIT_CRITICAL();\r
-                                       return pdPASS;\r
-                               }\r
-                               else\r
-                               {\r
-                                       if( xTicksToWait == ( TickType_t ) 0 )\r
-                                       {\r
-                                               taskEXIT_CRITICAL();\r
-                                               return errQUEUE_FULL;\r
-                                       }\r
-                                       else if( xEntryTimeSet == pdFALSE )\r
-                                       {\r
-                                               vTaskSetTimeOutState( &xTimeOut );\r
-                                               xEntryTimeSet = pdTRUE;\r
-                                       }\r
-                               }\r
-                       }\r
-                       taskEXIT_CRITICAL();\r
-\r
-                       taskENTER_CRITICAL();\r
-                       {\r
-                               if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
-                               {\r
-                                       if( prvIsQueueFull( pxQueue ) != pdFALSE )\r
-                                       {\r
-                                               traceBLOCKING_ON_QUEUE_SEND( pxQueue );\r
-                                               vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToSend ), xTicksToWait );\r
-                                               portYIELD_WITHIN_API();\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               mtCOVERAGE_TEST_MARKER();\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       taskEXIT_CRITICAL();\r
-                                       traceQUEUE_SEND_FAILED( pxQueue );\r
-                                       return errQUEUE_FULL;\r
-                               }\r
-                       }\r
-                       taskEXIT_CRITICAL();\r
-               }\r
-       }\r
-\r
-#endif /* configUSE_ALTERNATIVE_API */\r
-/*-----------------------------------------------------------*/\r
-\r
-#if ( configUSE_ALTERNATIVE_API == 1 )\r
-\r
-       BaseType_t xQueueAltGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )\r
-       {\r
-       BaseType_t xEntryTimeSet = pdFALSE;\r
-       TimeOut_t xTimeOut;\r
-       int8_t *pcOriginalReadPosition;\r
-       Queue_t * const pxQueue = ( Queue_t * ) xQueue;\r
-\r
-               configASSERT( pxQueue );\r
-               configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( UBaseType_t ) 0U ) ) );\r
-\r
-               for( ;; )\r
-               {\r
-                       taskENTER_CRITICAL();\r
-                       {\r
-                               if( pxQueue->uxMessagesWaiting > ( UBaseType_t ) 0 )\r
-                               {\r
-                                       /* Remember our read position in case we are just peeking. */\r
-                                       pcOriginalReadPosition = pxQueue->u.pcReadFrom;\r
-\r
-                                       prvCopyDataFromQueue( pxQueue, pvBuffer );\r
-\r
-                                       if( xJustPeeking == pdFALSE )\r
-                                       {\r
-                                               traceQUEUE_RECEIVE( pxQueue );\r
-\r
-                                               /* Data is actually being removed (not just peeked). */\r
-                                               --( pxQueue->uxMessagesWaiting );\r
-\r
-                                               #if ( configUSE_MUTEXES == 1 )\r
-                                               {\r
-                                                       if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
-                                                       {\r
-                                                               /* Record the information required to implement\r
-                                                               priority inheritance should it become necessary. */\r
-                                                               pxQueue->pxMutexHolder = ( int8_t * ) xTaskGetCurrentTaskHandle();\r
-                                                       }\r
-                                                       else\r
-                                                       {\r
-                                                               mtCOVERAGE_TEST_MARKER();\r
-                                                       }\r
-                                               }\r
-                                               #endif\r
-\r
-                                               if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToSend ) ) == pdFALSE )\r
-                                               {\r
-                                                       if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToSend ) ) != pdFALSE )\r
-                                                       {\r
-                                                               portYIELD_WITHIN_API();\r
-                                                       }\r
-                                                       else\r
-                                                       {\r
-                                                               mtCOVERAGE_TEST_MARKER();\r
-                                                       }\r
-                                               }\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               traceQUEUE_PEEK( pxQueue );\r
-\r
-                                               /* The data is not being removed, so reset our read\r
-                                               pointer. */\r
-                                               pxQueue->u.pcReadFrom = pcOriginalReadPosition;\r
-\r
-                                               /* The data is being left in the queue, so see if there are\r
-                                               any other tasks waiting for the data. */\r
-                                               if( listLIST_IS_EMPTY( &( pxQueue->xTasksWaitingToReceive ) ) == pdFALSE )\r
-                                               {\r
-                                                       /* Tasks that are removed from the event list will get added to\r
-                                                       the pending ready list as the scheduler is still suspended. */\r
-                                                       if( xTaskRemoveFromEventList( &( pxQueue->xTasksWaitingToReceive ) ) != pdFALSE )\r
-                                                       {\r
-                                                               /* The task waiting has a higher priority than this task. */\r
-                                                               portYIELD_WITHIN_API();\r
-                                                       }\r
-                                                       else\r
-                                                       {\r
-                                                               mtCOVERAGE_TEST_MARKER();\r
-                                                       }\r
-                                               }\r
-                                               else\r
-                                               {\r
-                                                       mtCOVERAGE_TEST_MARKER();\r
-                                               }\r
-                                       }\r
-\r
-                                       taskEXIT_CRITICAL();\r
-                                       return pdPASS;\r
-                               }\r
-                               else\r
-                               {\r
-                                       if( xTicksToWait == ( TickType_t ) 0 )\r
-                                       {\r
-                                               taskEXIT_CRITICAL();\r
-                                               traceQUEUE_RECEIVE_FAILED( pxQueue );\r
-                                               return errQUEUE_EMPTY;\r
-                                       }\r
-                                       else if( xEntryTimeSet == pdFALSE )\r
-                                       {\r
-                                               vTaskSetTimeOutState( &xTimeOut );\r
-                                               xEntryTimeSet = pdTRUE;\r
-                                       }\r
-                               }\r
-                       }\r
-                       taskEXIT_CRITICAL();\r
-\r
-                       taskENTER_CRITICAL();\r
-                       {\r
-                               if( xTaskCheckForTimeOut( &xTimeOut, &xTicksToWait ) == pdFALSE )\r
-                               {\r
-                                       if( prvIsQueueEmpty( pxQueue ) != pdFALSE )\r
-                                       {\r
-                                               traceBLOCKING_ON_QUEUE_RECEIVE( pxQueue );\r
-\r
-                                               #if ( configUSE_MUTEXES == 1 )\r
-                                               {\r
-                                                       if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
-                                                       {\r
-                                                               taskENTER_CRITICAL();\r
-                                                               {\r
-                                                                       vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
-                                                               }\r
-                                                               taskEXIT_CRITICAL();\r
-                                                       }\r
-                                                       else\r
-                                                       {\r
-                                                               mtCOVERAGE_TEST_MARKER();\r
-                                                       }\r
-                                               }\r
-                                               #endif\r
-\r
-                                               vTaskPlaceOnEventList( &( pxQueue->xTasksWaitingToReceive ), xTicksToWait );\r
-                                               portYIELD_WITHIN_API();\r
-                                       }\r
-                                       else\r
-                                       {\r
-                                               mtCOVERAGE_TEST_MARKER();\r
-                                       }\r
-                               }\r
-                               else\r
-                               {\r
-                                       taskEXIT_CRITICAL();\r
-                                       traceQUEUE_RECEIVE_FAILED( pxQueue );\r
-                                       return errQUEUE_EMPTY;\r
-                               }\r
-                       }\r
-                       taskEXIT_CRITICAL();\r
-               }\r
-       }\r
-\r
-\r
-#endif /* configUSE_ALTERNATIVE_API */\r
-/*-----------------------------------------------------------*/\r
-\r
 BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue, const void * const pvItemToQueue, BaseType_t * const pxHigherPriorityTaskWoken, const BaseType_t xCopyPosition )\r
 {\r
 BaseType_t xReturn;\r
index 4f2c29baded9276cc34bec0908d6f443182c14ad..b9acf3faab760908e3e6c24fc8f215e0dbe1a52d 100644 (file)
@@ -147,7 +147,7 @@ typedef struct tskTaskControlBlock
                xMPU_SETTINGS   xMPUSettings;           /*< The MPU settings are defined as part of the port layer.  THIS MUST BE THE SECOND MEMBER OF THE TCB STRUCT. */\r
        #endif\r
 \r
-       ListItem_t                      xGenericListItem;       /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */\r
+       ListItem_t                      xStateListItem; /*< The list that the state list item of a task is reference from denotes the state of that task (Ready, Blocked, Suspended ). */\r
        ListItem_t                      xEventListItem;         /*< Used to reference a task from an event list. */\r
        UBaseType_t                     uxPriority;                     /*< The priority of the task.  0 is the lowest priority. */\r
        StackType_t                     *pxStack;                       /*< Points to the start of the stack. */\r
@@ -260,8 +260,8 @@ PRIVILEGED_DATA static volatile TickType_t xNextTaskUnblockTime             = ( TickType_t
 PRIVILEGED_DATA static TaskHandle_t xIdleTaskHandle                                    = NULL;                 /*< Holds the handle of the idle task.  The idle task is created automatically when the scheduler is started. */\r
 \r
 /* Context switches are held pending while the scheduler is suspended.  Also,\r
-interrupts must not manipulate the xGenericListItem of a TCB, or any of the\r
-lists the xGenericListItem can be referenced from, if the scheduler is suspended.\r
+interrupts must not manipulate the xStateListItem of a TCB, or any of the\r
+lists the xStateListItem can be referenced from, if the scheduler is suspended.\r
 If an interrupt needs to unblock a task while the scheduler is suspended then it\r
 moves the task's event list item into the xPendingReadyList, ready for the\r
 kernel to move the task from the pending ready list into the real ready list\r
@@ -399,7 +399,7 @@ count overflows. */
 #define prvAddTaskToReadyList( pxTCB )                                                                                                                         \\r
        traceMOVED_TASK_TO_READY_STATE( pxTCB );                                                                                                                \\r
        taskRECORD_READY_PRIORITY( ( pxTCB )->uxPriority );                                                                                             \\r
-       vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xGenericListItem ) ); \\r
+       vListInsertEnd( &( pxReadyTasksLists[ ( pxTCB )->uxPriority ] ), &( ( pxTCB )->xStateListItem ) ); \\r
        tracePOST_MOVED_TASK_TO_READY_STATE( pxTCB )\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -526,7 +526,7 @@ static TCB_t *prvAllocateTCBAndStack( const uint16_t usStackDepth, StackType_t *
  */\r
 #if ( INCLUDE_xTaskGetTaskHandle == 1 )\r
 \r
-       static TCB_t *prvSearchForNameWithinSingleList( List_t *pxList, const char pcNameToQuery[] );\r
+       static TCB_t *prvSearchForNameWithinSingleList( List_t *pxList, const char pcNameToQuery[] ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
 \r
@@ -568,7 +568,7 @@ static void prvResetNextTaskUnblockTime( void );
         * Helper function used to pad task names with spaces when printing out\r
         * human readable tables of task information.\r
         */\r
-       static char *prvWriteNameToBuffer( char *pcBuffer, const char *pcTaskName );\r
+       static char *prvWriteNameToBuffer( char *pcBuffer, const char *pcTaskName ) PRIVILEGED_FUNCTION;\r
 \r
 #endif\r
 /*-----------------------------------------------------------*/\r
@@ -763,7 +763,7 @@ StackType_t *pxTopOfStack;
                        pxTCB = prvGetTCBFromHandle( xTaskToDelete );\r
 \r
                        /* Remove task from the ready list. */\r
-                       if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+                       if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
                        {\r
                                taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
                        }\r
@@ -789,7 +789,7 @@ StackType_t *pxTopOfStack;
                                Place the task in the termination list.  The idle task will\r
                                check the termination list and free up any memory allocated by\r
                                the scheduler for the TCB and stack of the deleted task. */\r
-                               vListInsertEnd( &xTasksWaitingTermination, &( pxTCB->xGenericListItem ) );\r
+                               vListInsertEnd( &xTasksWaitingTermination, &( pxTCB->xStateListItem ) );\r
 \r
                                /* Increment the ucTasksDeleted variable so the idle task knows\r
                                there is a task that has been deleted and that it should therefore\r
@@ -990,7 +990,7 @@ StackType_t *pxTopOfStack;
                {\r
                        taskENTER_CRITICAL();\r
                        {\r
-                               pxStateList = ( List_t * ) listLIST_ITEM_CONTAINER( &( pxTCB->xGenericListItem ) );\r
+                               pxStateList = ( List_t * ) listLIST_ITEM_CONTAINER( &( pxTCB->xStateListItem ) );\r
                        }\r
                        taskEXIT_CRITICAL();\r
 \r
@@ -1225,12 +1225,12 @@ StackType_t *pxTopOfStack;
                                nothing more than change it's priority variable. However, if\r
                                the task is in a ready list it needs to be removed and placed\r
                                in the list appropriate to its new priority. */\r
-                               if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxPriorityUsedOnEntry ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
+                               if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ uxPriorityUsedOnEntry ] ), &( pxTCB->xStateListItem ) ) != pdFALSE )\r
                                {\r
                                        /* The task is currently in its ready list - remove before adding\r
                                        it to it's new ready list.  As we are in a critical section we\r
                                        can do this even if the scheduler is suspended. */\r
-                                       if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+                                       if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
                                        {\r
                                                /* It is known that the task is in its ready list so\r
                                                there is no need to check again and the port level\r
@@ -1284,7 +1284,7 @@ StackType_t *pxTopOfStack;
 \r
                        /* Remove task from the ready/delayed list and place in the\r
                        suspended list. */\r
-                       if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+                       if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
                        {\r
                                taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
                        }\r
@@ -1303,7 +1303,7 @@ StackType_t *pxTopOfStack;
                                mtCOVERAGE_TEST_MARKER();\r
                        }\r
 \r
-                       vListInsertEnd( &xSuspendedTaskList, &( pxTCB->xGenericListItem ) );\r
+                       vListInsertEnd( &xSuspendedTaskList, &( pxTCB->xStateListItem ) );\r
                }\r
                taskEXIT_CRITICAL();\r
 \r
@@ -1372,7 +1372,7 @@ StackType_t *pxTopOfStack;
                configASSERT( xTask );\r
 \r
                /* Is the task being resumed actually in the suspended list? */\r
-               if( listIS_CONTAINED_WITHIN( &xSuspendedTaskList, &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
+               if( listIS_CONTAINED_WITHIN( &xSuspendedTaskList, &( pxTCB->xStateListItem ) ) != pdFALSE )\r
                {\r
                        /* Has the task already been resumed from within an ISR? */\r
                        if( listIS_CONTAINED_WITHIN( &xPendingReadyList, &( pxTCB->xEventListItem ) ) == pdFALSE )\r
@@ -1425,7 +1425,7 @@ StackType_t *pxTopOfStack;
 \r
                                        /* As we are in a critical section we can access the ready\r
                                        lists even if the scheduler is suspended. */\r
-                                       ( void ) uxListRemove(  &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove(  &( pxTCB->xStateListItem ) );\r
                                        prvAddTaskToReadyList( pxTCB );\r
 \r
                                        /* We may have just resumed a higher priority task. */\r
@@ -1506,7 +1506,7 @@ StackType_t *pxTopOfStack;
                                                mtCOVERAGE_TEST_MARKER();\r
                                        }\r
 \r
-                                       ( void ) uxListRemove(  &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove(  &( pxTCB->xStateListItem ) );\r
                                        prvAddTaskToReadyList( pxTCB );\r
                                }\r
                                else\r
@@ -1723,7 +1723,7 @@ BaseType_t xAlreadyYielded = pdFALSE;
                                {\r
                                        pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xPendingReadyList ) );\r
                                        ( void ) uxListRemove( &( pxTCB->xEventListItem ) );\r
-                                       ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
                                        prvAddTaskToReadyList( pxTCB );\r
 \r
                                        /* If the moved task has a priority higher than the current\r
@@ -2117,9 +2117,9 @@ implementations require configUSE_TICKLESS_IDLE to be set to a value other than
                        if( eTaskGetState( xTask ) == eBlocked )\r
                        {\r
                                /* Remove the reference to the task from the blocked list.  An\r
-                               interrupt won't touch the xGenericListItem because the\r
+                               interrupt won't touch the xStateListItem because the\r
                                scheduler is suspended. */\r
-                               ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                               ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
 \r
                                /* Is the task waiting on an event also?  If so remove it from\r
                                the event list too.  Interrupts can touch the event list item,\r
@@ -2230,7 +2230,7 @@ BaseType_t xSwitchRequired = pdFALSE;
                                                at which the task at the head of the delayed list must\r
                                                be removed from the Blocked state. */\r
                                                pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );\r
-                                               xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xGenericListItem ) );\r
+                                               xItemValue = listGET_LIST_ITEM_VALUE( &( pxTCB->xStateListItem ) );\r
 \r
                                                if( xConstTickCount < xItemValue )\r
                                                {\r
@@ -2248,7 +2248,7 @@ BaseType_t xSwitchRequired = pdFALSE;
                                                }\r
 \r
                                                /* It is time to remove the item from the Blocked state. */\r
-                                               ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                                               ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
 \r
                                                /* Is the task waiting on an event also?  If so remove\r
                                                it from the event list. */\r
@@ -2596,7 +2596,7 @@ BaseType_t xReturn;
 \r
        if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )\r
        {\r
-               ( void ) uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
+               ( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) );\r
                prvAddTaskToReadyList( pxUnblockedTCB );\r
        }\r
        else\r
@@ -2661,7 +2661,7 @@ BaseType_t xReturn;
        /* Remove the task from the delayed list and add it to the ready list.  The\r
        scheduler is suspended so interrupts will not be accessing the ready\r
        lists. */\r
-       ( void ) uxListRemove( &( pxUnblockedTCB->xGenericListItem ) );\r
+       ( void ) uxListRemove( &( pxUnblockedTCB->xStateListItem ) );\r
        prvAddTaskToReadyList( pxUnblockedTCB );\r
 \r
        if( pxUnblockedTCB->uxPriority > pxCurrentTCB->uxPriority )\r
@@ -3001,12 +3001,12 @@ UBaseType_t x;
        }\r
        #endif /* configUSE_MUTEXES */\r
 \r
-       vListInitialiseItem( &( pxTCB->xGenericListItem ) );\r
+       vListInitialiseItem( &( pxTCB->xStateListItem ) );\r
        vListInitialiseItem( &( pxTCB->xEventListItem ) );\r
 \r
        /* Set the pxTCB as a link back from the ListItem_t.  This is so we can get\r
        back to the containing TCB from a generic item in a list. */\r
-       listSET_LIST_ITEM_OWNER( &( pxTCB->xGenericListItem ), pxTCB );\r
+       listSET_LIST_ITEM_OWNER( &( pxTCB->xStateListItem ), pxTCB );\r
 \r
        /* Event lists are always in priority order. */\r
        listSET_LIST_ITEM_VALUE( &( pxTCB->xEventListItem ), ( TickType_t ) configMAX_PRIORITIES - ( TickType_t ) uxPriority ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */\r
@@ -3185,7 +3185,7 @@ static void prvCheckTasksWaitingTermination( void )
                                taskENTER_CRITICAL();\r
                                {\r
                                        pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );\r
-                                       ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
                                        --uxCurrentNumberOfTasks;\r
                                        --uxDeletedTasksWaitingCleanUp;\r
                                }\r
@@ -3565,7 +3565,7 @@ TCB_t *pxTCB;
                which the task at the head of the delayed list should be removed\r
                from the Blocked state. */\r
                ( pxTCB ) = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedTaskList );\r
-               xNextTaskUnblockTime = listGET_LIST_ITEM_VALUE( &( ( pxTCB )->xGenericListItem ) );\r
+               xNextTaskUnblockTime = listGET_LIST_ITEM_VALUE( &( ( pxTCB )->xStateListItem ) );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -3644,9 +3644,9 @@ TCB_t *pxTCB;
 \r
                                /* If the task being modified is in the ready state it will need\r
                                to be moved into a new list. */\r
-                               if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xGenericListItem ) ) != pdFALSE )\r
+                               if( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxTCB->uxPriority ] ), &( pxTCB->xStateListItem ) ) != pdFALSE )\r
                                {\r
-                                       if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+                                       if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
                                        {\r
                                                taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
                                        }\r
@@ -3711,7 +3711,7 @@ TCB_t *pxTCB;
                                        given from an interrupt, and if a mutex is given by the\r
                                        holding task then it must be the running state task.  Remove\r
                                        the     holding task from the ready     list. */\r
-                                       if( uxListRemove( &( pxTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+                                       if( uxListRemove( &( pxTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
                                        {\r
                                                taskRESET_READY_PRIORITY( pxTCB->uxPriority );\r
                                        }\r
@@ -4306,7 +4306,7 @@ TickType_t uxReturn;
                        notification then unblock it now. */\r
                        if( ucOriginalNotifyState == taskWAITING_NOTIFICATION )\r
                        {\r
-                               ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                               ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
                                prvAddTaskToReadyList( pxTCB );\r
 \r
                                /* The task should not have been on an event list. */\r
@@ -4436,7 +4436,7 @@ TickType_t uxReturn;
 \r
                                if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )\r
                                {\r
-                                       ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
                                        prvAddTaskToReadyList( pxTCB );\r
                                }\r
                                else\r
@@ -4526,7 +4526,7 @@ TickType_t uxReturn;
 \r
                                if( uxSchedulerSuspended == ( UBaseType_t ) pdFALSE )\r
                                {\r
-                                       ( void ) uxListRemove( &( pxTCB->xGenericListItem ) );\r
+                                       ( void ) uxListRemove( &( pxTCB->xStateListItem ) );\r
                                        prvAddTaskToReadyList( pxTCB );\r
                                }\r
                                else\r
@@ -4612,7 +4612,7 @@ TickType_t xTimeToWake;
 \r
        /* Remove the task from the ready list before adding it to the blocked list\r
        as the same list item is used for both lists. */\r
-       if( uxListRemove( &( pxCurrentTCB->xGenericListItem ) ) == ( UBaseType_t ) 0 )\r
+       if( uxListRemove( &( pxCurrentTCB->xStateListItem ) ) == ( UBaseType_t ) 0 )\r
        {\r
                /* The current task must be in a ready list, so there is no need to\r
                check, and the port reset macro can be called directly. */\r
@@ -4631,7 +4631,7 @@ TickType_t xTimeToWake;
                        /* Add the task to the suspended task list instead of a delayed task\r
                        list to ensure it is not woken by a timing event.  It will block\r
                        indefinitely. */\r
-                       vListInsertEnd( &xSuspendedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+                       vListInsertEnd( &xSuspendedTaskList, &( pxCurrentTCB->xStateListItem ) );\r
                }\r
                else\r
                {\r
@@ -4641,19 +4641,19 @@ TickType_t xTimeToWake;
                        xTimeToWake = xTickCount + xTicksToWait;\r
 \r
                        /* The list item will be inserted in wake time order. */\r
-                       listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );\r
+                       listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xStateListItem ), xTimeToWake );\r
 \r
                        if( xTimeToWake < xTickCount )\r
                        {\r
                                /* Wake time has overflowed.  Place this item in the overflow\r
                                list. */\r
-                               vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+                               vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );\r
                        }\r
                        else\r
                        {\r
                                /* The wake time has not overflowed, so the current block list\r
                                is used. */\r
-                               vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+                               vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );\r
 \r
                                /* If the task entering the blocked state was placed at the\r
                                head of the list of blocked tasks then xNextTaskUnblockTime\r
@@ -4677,17 +4677,17 @@ TickType_t xTimeToWake;
                xTimeToWake = xTickCount + xTicksToWait;\r
 \r
                /* The list item will be inserted in wake time order. */\r
-               listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xGenericListItem ), xTimeToWake );\r
+               listSET_LIST_ITEM_VALUE( &( pxCurrentTCB->xStateListItem ), xTimeToWake );\r
 \r
                if( xTimeToWake < xTickCount )\r
                {\r
                        /* Wake time has overflowed.  Place this item in the overflow list. */\r
-                       vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+                       vListInsert( pxOverflowDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );\r
                }\r
                else\r
                {\r
                        /* The wake time has not overflowed, so the current block list is used. */\r
-                       vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xGenericListItem ) );\r
+                       vListInsert( pxDelayedTaskList, &( pxCurrentTCB->xStateListItem ) );\r
 \r
                        /* If the task entering the blocked state was placed at the head of the\r
                        list of blocked tasks then xNextTaskUnblockTime needs to be updated\r