1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-11-14 20:36:03 +01:00
cdf2018-principal/arduino/principal.c
2018-02-07 17:57:01 +01:00

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;
}