/* * kernel.c * * Created on: 13.09.2011 * Author: Roland */ #include "Types.h" #include "FreeRTOS.h" #include "queue.h" #define kernel_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define kernel_TASK_STACK_SIZE ( ( unsigned short ) 32 ) /* Globals */ xQueueHandle * gpxQueue_Kernel; //static xTaskHandle *pkernel_TaskHandle; //static Task_Param_t kernel_Param; xTaskHandle *pkernel_TaskHandle; Task_Param_t kernel_Param; /* * Wake up other tasks, send them messages telling what to do, * wait for them to have processed the commands or not, maybe * put them to sleep again, ... * */ static void kernel_Process_Task(void *Param) { Message_t Msg; while(1) { xQueueReceive( gpxQueue_Kernel, &Msg, portMAX_DELAY ); /*TODO: execute desired command of message */ /* * switch Msg.Sender * * case Sender_Kernel: * yeah, that's myself * */ } } Status_t kernel_Init_Kernel(xQueueHandle * pxQueue) { kernel_Param.pxQueue = pxQueue; xTaskCreate( kernel_Process_Task, (signed char *) "Kernel", kernel_TASK_STACK_SIZE, &kernel_Param, kernel_TASK_PRIORITY, pkernel_TaskHandle ); /*TODO: check for success and pass it over to caller. */ return STATUS_OK; }