Files
avr_328p_freertos/main.c
2019-04-17 15:59:38 -05:00

50 lines
946 B
C

/*
* main.c
*
* Created on: Feb 4, 2015
* Author: jcobb
*/
#include <avr/io.h>
#include "FreeRTOS.h"
#include "task.h"
#include "apptasks.h"
#define mainLED_TASK_PRIORITY (tskIDLE_PRIORITY)
#define mainLED_TASK_PRIORITY (tskIDLE_PRIORITY+1)
// #define mainNEXT_TASK_2 (tskIDLE_PRIORITY+2)
// #define mainNEXT_TASK_3 (tskIDLE_PRIORITY+3)
// TODO: Research moving vLEDFlashTask method to apptasks.c
void vLEDFlashTask(void *pvParms)
{
vLEDInit();
portTickType xLastWakeTime;
const portTickType xFrequency = 1000;
xLastWakeTime = xTaskGetTickCount();
for(;;) {
vLEDToggle();
vTaskDelayUntil(&xLastWakeTime, xFrequency);
}
}
void init(void);
void vApplicationIdleHook( void );
portSHORT main(void)
{
xTaskCreate(vLEDFlashTask, (int8_t*) "LED", configMINIMAL_STACK_SIZE, NULL, mainLED_TASK_PRIORITY, NULL);
vTaskStartScheduler();
return 0;
}
void vApplicationIdleHook( void )
{
//vCoRoutineSchedule();
}