1
0
Fork 0
mirror of https://github.com/RobotechLille/cdf2018-principal synced 2024-11-23 16:46:04 +01:00
cdf2018-principal/arduino/principal.c

40 lines
834 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>
2018-02-14 18:07:10 +01:00
#include "AC.h"
#include "AF.h"
2018-02-14 18:07:10 +01:00
#include "position.h"
#include "movement.h"
2018-02-14 18:27:04 +01:00
#include "debug.h"
void TaskBlink(void *pvParameters) {
2018-02-07 17:57:01 +01:00
(void) pvParameters;
TickType_t xLastWakeTime;
TickType_t xFrequency = 200 / 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);
}
}
2018-02-16 22:13:24 +01:00
int main(void) {
2018-02-14 18:27:04 +01:00
configureAC(); // Doit rester en premier :)
configureAF(); // Doit rester en premier :)
2018-02-14 18:07:10 +01:00
configureMovement();
configurePosition();
2018-02-14 18:27:04 +01:00
configureDebug();
2018-02-07 17:57:01 +01:00
xTaskCreate(TaskBlink, "Blink", 128, NULL, 2, NULL);
2018-02-14 18:07:10 +01:00
sei();
2018-02-07 17:57:01 +01:00
vTaskStartScheduler();
return 0;
}