I am trying to understand how do we decide a task priority in free rtos programming. I have been seen in free rtos documents but struggling
Atmel Studio 7
Device: ATmega32A
OS: Window 10
Free RTOS :10.3.0.
[code] #include <stdlib.h>
#include <string.h>
#ifdef GCC_MEGA_AVR
/* EEPROM routines used only with the WinAVR compiler. */
#include <avr/eeprom.h>
#endif
/* Scheduler include files. */
#include “FreeRTOS.h”
#include “task.h”
#include “croutine.h”
void vTask1( void *pvParameters )
{
const char pcTaskName = “Task 1 is running\r\n”;
volatile uint32_t ul; / volatile to ensure ul is not optimized away. */
for( ;; )
{
/* Print out the name of this task. */
vPrintString( pcTaskName );
/* Delay for a period. */
for( ul = 0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
}
}
void vTask2( void *pvParameters )
{
const char pcTaskName = “Task 2 is running\r\n”;
volatile uint32_t ul; / volatile to ensure ul is not optimized away. */
for( ;; )
{
/* Print out the name of this task. */
vPrintString( pcTaskName );
/* Delay for a period. */
for( ul = 0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
}
}
void vTask3( void *pvParameters )
{
const char pcTaskName = “Task 3 is running\r\n”;
volatile uint32_t ul; / volatile to ensure ul is not optimized away. */
for( ;; )
{
/* Print out the name of this task. */
vPrintString( pcTaskName );
/* Delay for a period. */
for( ul = 0; ul < mainDELAY_LOOP_COUNT; ul++ )
{
}
}
}
int main( void )
{
xTaskCreate( vTask1, “Task 1”, 1000, NULL, 2, NULL );
xTaskCreate( vTask2, “Task 2”, 1000, NULL, 1, NULL );
xTaskCreate( vTask2, “Task 2”, 1000, NULL, 3, NULL );
vTaskStartScheduler();
for( ;; );
}
[/code]
How to set task priorities in the code ?