0% found this document useful (0 votes)
2 views3 pages

Task Create

The document outlines a program that initializes a microcontroller system and sets up an embedded UART library. It creates three tasks with different priorities and an idle task that runs when no other tasks are active. Each task prints a message to the UART at specified intervals, and the scheduler is started to manage task execution.

Uploaded by

laksmi krushitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Task Create

The document outlines a program that initializes a microcontroller system and sets up an embedded UART library. It creates three tasks with different priorities and an idle task that runs when no other tasks are active. Each task prints a message to the UART at specified intervals, and the scheduler is started to manage task execution.

Uploaded by

laksmi krushitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 3

// Explore Emnedded UART library

/* Local Tasks declaration */

static void MyTask1(void* pvParameters);

static void MyTask2(void* pvParameters);

static void MyTask3(void* pvParameters);

static void MyIdleTask(void* pvParameters);

int main(void)

SystemInit(); /* Initialize the microcontroller system */

UART_Init(38400); /* Initialize the Uart module */

/* Create the three tasks with priorities 1,2,3. Only tasks will be created.

* Tasks will be excecuted once the scheduler is started.

* An idle task is also created, which will be run when there are no tasks in RUN state */

xTaskCreate( MyTask1, ( signed char * )"Task1", configMINIMAL_STACK_SIZE, NULL, 1, NULL );

xTaskCreate( MyTask2, ( signed char * )"Task2", configMINIMAL_STACK_SIZE, NULL, 2, NULL );

xTaskCreate( MyTask3, ( signed char * )"Task3", configMINIMAL_STACK_SIZE, NULL, 3, NULL );

xTaskCreate( MyIdleTask, ( signed char * )"IdleTask", configMINIMAL_STACK_SIZE, NULL,


tskIDLE_PRIORITY, NULL );

UART_Printf("\n\rIn the main");

vTaskStartScheduler(); /* Start the schedular */


while(1);

/* Task1 with priority 1 */

static void MyTask1(void* pvParameters)

while(1)

UART_Printf("\n\rTask1");

vTaskDelay(100);

/* Task1 with priority 2 */

static void MyTask2(void* pvParameters)

while(1)

UART_Printf("\n\rTask2");

vTaskDelay(250);

}
/* Task1 with priority 3 */

static void MyTask3(void* pvParameters)

while(1)

UART_Printf("\n\rTask3");

vTaskDelay(600);

static void MyIdleTask(void* pvParameters)

while(1)

UART_Printf("\n\rIn idle state");

You might also like