]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/MSVC-MingW/port.c
Update version numbers in preparation for new release.
[freertos] / FreeRTOS / Source / portable / MSVC-MingW / port.c
index 056407213a502a1818f550c70e76d6035d945018..54ca3ca5e78038de29f59aab7e27f9885d4eeb1f 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.2 - 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
     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
+    ***************************************************************************\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
 \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
     ***************************************************************************\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
+    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
+    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
+    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
@@ -312,12 +312,13 @@ xThreadState *pxThreadState;
                tick interrupts.  The priority is set below that of the simulated\r
                interrupt handler so the interrupt event mutex is used for the\r
                handshake / overrun protection. */\r
-               pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, 0, NULL );\r
+               pvHandle = CreateThread( NULL, 0, prvSimulatedPeripheralTimer, NULL, CREATE_SUSPENDED, NULL );\r
                if( pvHandle != NULL )\r
                {\r
                        SetThreadPriority( pvHandle, THREAD_PRIORITY_BELOW_NORMAL );\r
                        SetThreadPriorityBoost( pvHandle, TRUE );\r
                        SetThreadAffinityMask( pvHandle, 0x01 );\r
+                       ResumeThread( pvHandle );\r
                }\r
 \r
                /* Start the highest priority task by obtaining its associated thread\r
@@ -364,6 +365,7 @@ static void prvProcessSimulatedInterrupts( void )
 uint32_t ulSwitchRequired, i;\r
 xThreadState *pxThreadState;\r
 void *pvObjectList[ 2 ];\r
+CONTEXT xContext;\r
 \r
        /* Going to block on the mutex that ensured exclusive access to the simulated\r
        interrupt objects, and the event that signals that a simulated interrupt\r
@@ -425,6 +427,13 @@ void *pvObjectList[ 2 ];
                                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
+                               actually suspended.  The below code asks for dummy register\r
+                               data. */\r
+                               xContext.ContextFlags = CONTEXT_INTEGER;\r
+                               ( void ) GetThreadContext( pxThreadState->pvThread, &xContext );\r
+\r
                                /* Obtain the state of the task now selected to enter the\r
                                Running state. */\r
                                pxThreadState = ( xThreadState * ) ( *( size_t *) pxCurrentTCB );\r