summaryrefslogtreecommitdiff
path: root/software/mpu.old/src/boot.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/mpu.old/src/boot.c')
-rw-r--r--software/mpu.old/src/boot.c78
1 files changed, 78 insertions, 0 deletions
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();
+}
+