From 3ab7176e463268a471eb0e90c8520be4ff15a42f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 28 May 2013 19:22:38 +0000 Subject: moved old FreeRTOS based MPU Softeware to mpu.old git-svn-id: https://svn.spreadspace.org/mur.sat@768 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/mpu.old/src/boot.c | 78 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 software/mpu.old/src/boot.c (limited to 'software/mpu.old/src/boot.c') diff --git a/software/mpu.old/src/boot.c b/software/mpu.old/src/boot.c new file mode 100644 index 0000000..825aac5 --- /dev/null +++ b/software/mpu.old/src/boot.c @@ -0,0 +1,78 @@ +/* + * boot.c + * + * Created on: 13.09.2011 + * Author: Roland + */ + +#include "Types.h" +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" + +#define NUM_QUEUE_ITEMS_KERNEL ((unsigned long) 2) +#define NUM_QUEUE_ITEMS_CAMERA ((unsigned long) 2) +#define NUM_QUEUE_ITEMS_LIGHTSENS ((unsigned long) 2) + +Status_t kernel_Init_Kernel(QH_t xQueues); +Status_t camera_Init_Camera(QH_t xQueues); +Status_t lightsens_Init_LightSens(QH_t xQueues); + +void UARTInit(uint32_t baudrate); + +/* + * Globals */ +volatile QH_t qh; + +Status_t boot_Init_Kernel(QH_t xQueues) +{ + return kernel_Init_Kernel( xQueues ); +} +Status_t boot_Init_Camera(QH_t xQueues) +{ + return camera_Init_Camera( xQueues ); +} +Status_t boot_Init_LightSens(QH_t xQueues) +{ + return lightsens_Init_LightSens( xQueues ); +} + +Status_t boot_CreateQueues( xQueueHandle *phxQueue_Kernel, + xQueueHandle *phxQueue_Camera, + xQueueHandle *phxQueue_LightSens) +{ + *phxQueue_Kernel = xQueueCreate(NUM_QUEUE_ITEMS_KERNEL, sizeof(Message_t)); + *phxQueue_Camera = xQueueCreate(NUM_QUEUE_ITEMS_CAMERA, sizeof(Message_t)); + *phxQueue_LightSens = xQueueCreate(NUM_QUEUE_ITEMS_LIGHTSENS, sizeof(Message_t)); + + return STATUS_OK; + +} +void boot_Main(void) +{ + /* + * + * */ + + xQueueHandle hxQueue_Kernel; + xQueueHandle hxQueue_Camera; + xQueueHandle hxQueue_LightSens; + + Status_t Status; + + Status = boot_CreateQueues(&hxQueue_Kernel, &hxQueue_Camera, &hxQueue_LightSens); + + qh.hxq_Kernel = hxQueue_Kernel; + qh.hxq_Camera = hxQueue_Camera; + qh.hxq_LightSens = hxQueue_LightSens; + + Status = boot_Init_Kernel(qh); + Status = boot_Init_Camera(qh); + Status = boot_Init_LightSens(qh); + + UARTInit(115200); + + /* Start the tasks. */ + vTaskStartScheduler(); +} + -- cgit v1.2.3