I’m a beginner at FreeRTOS, I’ve wrote a simple application that turn on and off between two leds (each task turns a led on and turn off the other).
The problem is i’ve wrote the two tasks but the schedular puts a task in running and switch to the other and stops at this task without switching again.
Maybe i’ve missunderstood how it works. So please help would be appreciated. This is the code i’ve written
~~~~
define F_CPU 8000000UL
include <avr/io.h>
include “freertos/FreeRTOS.h”
include “freertos/task.h”
include “freertos/FreeRTOSConfig.h”
void task
one(void *pvParameters);
void tasktwo(void *pvParameters);
int main(void)
{
DDRC = 0xff;
xTaskCreate(task
one, NULL, 50, NULL, 1, NULL);
xTaskCreate(tasktwo, NULL, 50, NULL, 1, NULL);
vTaskStartScheduler();
return 0;
}
void task_one(void *pvParameters)
{
while(1)
{
PORTC = 0x0f;
}
}
void task_two(void *pvParameters)
{
while(1)
{
PORTC = 0xf0;
}
}
~~~~