]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/death.c
Notes:
[freertos] / FreeRTOS / Demo / Common / Minimal / death.c
index 03558130ca53076e74da075991f9b2f08bf5b279..d343b42fdfc0a666438e53925907e654e15ad815 100644 (file)
@@ -129,14 +129,7 @@ TaskHandle_t xCreatedTask;
 \r
 void vCreateSuicidalTasks( UBaseType_t uxPriority )\r
 {\r
-UBaseType_t *puxPriority;\r
-\r
-       /* Create the Creator tasks - passing in as a parameter the priority at which\r
-       the suicidal tasks should be created. */\r
-       puxPriority = ( UBaseType_t * ) pvPortMalloc( sizeof( UBaseType_t ) );\r
-       *puxPriority = uxPriority;\r
-\r
-       xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );\r
+       xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) NULL, uxPriority, NULL );\r
 \r
        /* Record the number of tasks that are running now so we know if any of the\r
        suicidal tasks have failed to be killed. */\r
@@ -206,8 +199,10 @@ static portTASK_FUNCTION( vCreateTasks, pvParameters )
 const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 1000 );\r
 UBaseType_t uxPriority;\r
 \r
-       uxPriority = *( UBaseType_t * ) pvParameters;\r
-       vPortFree( pvParameters );\r
+       /* Remove compiler warning about unused parameter. */\r
+       ( void ) pvParameters;\r
+\r
+       uxPriority = uxTaskPriorityGet( NULL );\r
 \r
        for( ;; )\r
        {\r