mirror of
https://github.com/RobotechLille/cdf2018-principal
synced 2024-11-14 12:26:06 +01:00
32 lines
630 B
C
32 lines
630 B
C
#include <avr/io.h>
|
|
#include <avr/interrupt.h>
|
|
#include <FreeRTOS.h>
|
|
#include <task.h>
|
|
|
|
#include "serial.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();
|
|
sei();
|
|
|
|
xTaskCreate(TaskBlink, "Blink", 128, NULL, 2, NULL);
|
|
vTaskStartScheduler();
|
|
return 0;
|
|
}
|