1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-09-29 00:33:04 +02:00
cdf2018-principal/arduino/principal.c

32 lines
630 B
C
Raw Normal View History

#include <avr/io.h>
#include <avr/interrupt.h>
2018-02-07 17:57:01 +01:00
#include <FreeRTOS.h>
#include <task.h>
#include "serial.h"
unsigned char speed = 200;
void TaskBlink(void *pvParameters) {
2018-02-07 17:57:01 +01:00
(void) pvParameters;
TickType_t xLastWakeTime;
TickType_t xFrequency = speed / portTICK_PERIOD_MS;
2018-02-07 17:57:01 +01:00
DDRB = 0xFF;
xLastWakeTime = xTaskGetTickCount();
for (;;) {
2018-02-07 17:57:01 +01:00
PORTB = PINB ^ 0xFF;
vTaskDelayUntil(&xLastWakeTime, xFrequency);
}
}
int main(void) {
configureAC();
sei();
2018-02-07 17:57:01 +01:00
xTaskCreate(TaskBlink, "Blink", 128, NULL, 2, NULL);
vTaskStartScheduler();
return 0;
}