summaryrefslogtreecommitdiff
path: root/software/mpu/src/camera.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/mpu/src/camera.c')
-rw-r--r--software/mpu/src/camera.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/software/mpu/src/camera.c b/software/mpu/src/camera.c
new file mode 100644
index 0000000..4fad440
--- /dev/null
+++ b/software/mpu/src/camera.c
@@ -0,0 +1,56 @@
+/*
+ * camera.c
+ *
+ * Created on: 23.10.2011
+ * Author: Roland
+ */
+
+#include "Types.h"
+#include "FreeRTOS.h"
+#include "queue.h"
+
+#define TASK_PRIORITY_camera ( tskIDLE_PRIORITY + 2 )
+#define TASK_STACK_SIZE_camera ( ( unsigned short ) 64 )
+
+/* Globals */
+static Task_Param_t TaskParam_Camera;
+
+/*
+ * 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 camera_Process_Task(void *Param)
+{
+ Message_t Msg;
+
+ if(NULL == TaskParam_Camera.QueueHandles.hxq_Camera)
+ {
+ return;
+ }
+ while(1)
+ {
+ if( xQueueReceive( TaskParam_Camera.QueueHandles.hxq_Camera,
+ &Msg, portTICK_RATE_MS * 5 ))
+ {
+ /*
+ * switch Msg.Sender
+ *
+ */
+ ;
+ }
+ }
+}
+
+Status_t camera_Init_Camera(QH_t hxQueues)
+{
+ TaskParam_Camera.QueueHandles = hxQueues;
+
+ if(!xTaskCreate( camera_Process_Task, (signed char *) "Camera",
+ TASK_STACK_SIZE_camera, &TaskParam_Camera,
+ TASK_PRIORITY_camera, &(TaskParam_Camera.hxTask_Self)))
+ return STATUS_ERROR_INIT;
+
+ /*TODO: check for success and pass it over to caller. */
+ return STATUS_OK;
+}