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

37 lines
726 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 "position.h"
#include "movement.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();
2018-02-14 18:07:10 +01:00
configureMovement();
configurePosition();
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;
}