Changes to the FreeRTOS code:

+ Introduced xTaskCreateStatic() to allow tasks to be created without any dynamic memory allocation.
+ When a task notification is used to unblock a task from an ISR, but the xHigherPriorityTaskWoken parameter is not used, then pend a context switch to occur during the next tick interrupt.

Demo application changes:
+ Updated TaskNotify.c to test the case where a task is unblocked by an ISR, but does not use its xHigherPriorityTaskWoken parameter.
+ Updated the Win32 MSVC project to test statically allocated tasks being created and deleted.
+ Introduced StaticAllocation.c standard demo task.
This commit is contained in:
Richard Barry 2015-12-20 13:44:21 +00:00
parent 7d6609f8db
commit ea95020ffd
15 changed files with 839 additions and 115 deletions

View file

@ -114,9 +114,11 @@ task can tell if any of the suicidal tasks have failed to die.
*/
static volatile UBaseType_t uxTasksRunningAtStart = 0;
/* Tasks are deleted by the idle task. Under heavy load the idle task might
not get much processing time, so it would be legitimate for several tasks to
remain undeleted for a short period. */
/* When a task deletes itself, it stack and TCB are cleaned up by the Idle task.
Under heavy load the idle task might not get much processing time, so it would
be legitimate for several tasks to remain undeleted for a short period. There
may also be a few other unexpected tasks if, for example, the tasks that test
static allocation are also being used. */
static const UBaseType_t uxMaxNumberOfExtraTasksRunning = 3;
/* Used to store a handle to the task that should be killed by a suicidal task,
@ -151,7 +153,9 @@ UBaseType_t *puxPriority;
If this is done, then uxTasksRunningAtStart needs incrementing again as that
too is created when the scheduler is started. */
#if configUSE_TIMERS == 1
{
uxTasksRunningAtStart++;
}
#endif
}
/*-----------------------------------------------------------*/