mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-11-14 20:36:03 +01:00
27 lines
526 B
C
27 lines
526 B
C
#include <FreeRTOS.h>
|
|
#include <task.h>
|
|
#include <avr/io.h>
|
|
|
|
void TaskBlink(void *pvParameters)
|
|
{
|
|
(void) pvParameters;
|
|
TickType_t xLastWakeTime;
|
|
const TickType_t xFrequency = 200 / portTICK_PERIOD_MS;
|
|
|
|
DDRB = 0xFF;
|
|
|
|
xLastWakeTime = xTaskGetTickCount();
|
|
for (;;)
|
|
{
|
|
PORTB = PINB ^ 0xFF;
|
|
vTaskDelayUntil(&xLastWakeTime, xFrequency);
|
|
}
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
xTaskCreate(TaskBlink, "Blink", 128, NULL, 2, NULL);
|
|
vTaskStartScheduler();
|
|
return 0;
|
|
}
|