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