]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/tasks.c
Final V8.2.1 release ready for tagging:
[freertos] / FreeRTOS / Source / tasks.c
index 822338df1d1f4117fbaf5ed50b15fc1d2ac4cfde..426ee2d591f9460d0b848d04ad1493128306ebb4 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.1 - 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
@@ -555,7 +555,7 @@ TCB_t * pxNewTCB;
 StackType_t *pxTopOfStack;\r
 \r
        configASSERT( pxTaskCode );\r
-       configASSERT( ( ( uxPriority & ( ~portPRIVILEGE_BIT ) ) < configMAX_PRIORITIES ) );\r
+       configASSERT( ( ( uxPriority & ( UBaseType_t ) ( ~portPRIVILEGE_BIT ) ) < ( UBaseType_t ) configMAX_PRIORITIES ) );\r
 \r
        /* Allocate the memory required by the TCB and stack for the new task,\r
        checking that the allocation was successful. */\r
@@ -4101,7 +4101,7 @@ TickType_t uxReturn;
 \r
 #if( configUSE_TASK_NOTIFICATIONS == 1 )\r
 \r
-       BaseType_t xTaskNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction )\r
+       BaseType_t xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue )\r
        {\r
        TCB_t * pxTCB;\r
        eNotifyValue eOriginalNotifyState;\r
@@ -4112,6 +4112,11 @@ TickType_t uxReturn;
 \r
                taskENTER_CRITICAL();\r
                {\r
+                       if( pulPreviousNotificationValue != NULL )\r
+                       {\r
+                               *pulPreviousNotificationValue = pxTCB->ulNotifiedValue;\r
+                       }\r
+\r
                        eOriginalNotifyState = pxTCB->eNotifyState;\r
 \r
                        pxTCB->eNotifyState = eNotified;\r