1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-11-14 12:26:06 +01:00
cdf2018-principal/arduino/principal.c
2018-02-14 18:27:04 +01:00

39 lines
798 B
C

#include <avr/io.h>
#include <avr/interrupt.h>
#include <FreeRTOS.h>
#include <task.h>
#include "AC.h"
#include "position.h"
#include "movement.h"
#include "debug.h"
unsigned char speed = 200;
void TaskBlink(void *pvParameters) {
(void) pvParameters;
TickType_t xLastWakeTime;
TickType_t xFrequency = speed / portTICK_PERIOD_MS;
DDRB = 0xFF;
xLastWakeTime = xTaskGetTickCount();
for (;;) {
PORTB = PINB ^ 0xFF;
vTaskDelayUntil(&xLastWakeTime, xFrequency);
}
}
int main(void) {
configureAC(); // Doit rester en premier :)
configureMovement();
configurePosition();
configureDebug();
xTaskCreate(TaskBlink, "Blink", 128, NULL, 2, NULL);
sei();
vTaskStartScheduler();
return 0;
}