From 7446bd874823bb058d872fa0718ff774379e8118 Mon Sep 17 00:00:00 2001 From: Roland Sahlsten Date: Tue, 8 May 2012 06:43:34 +0000 Subject: git-svn-id: https://svn.spreadspace.org/mur.sat@403 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/mpu/src/camera.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'software/mpu/src/camera.c') diff --git a/software/mpu/src/camera.c b/software/mpu/src/camera.c index 4fad440..8ec62d3 100644 --- a/software/mpu/src/camera.c +++ b/software/mpu/src/camera.c @@ -16,28 +16,34 @@ 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, ... + * The camera is connected to the MPU vie I2C to control the camera, + * and has a 8 bit bus for data transmission ... * */ static void camera_Process_Task(void *Param) { Message_t Msg; + portCHAR chMsgBufCam[10] = "Hello Kl!"; if(NULL == TaskParam_Camera.QueueHandles.hxq_Camera) { return; } + while(1) { - if( xQueueReceive( TaskParam_Camera.QueueHandles.hxq_Camera, - &Msg, portTICK_RATE_MS * 5 )) + if( xQueueReceive( TaskParam_Camera.QueueHandles.hxq_Camera, &Msg, MS(5) )) { - /* - * switch Msg.Sender - * - */ - ; + switch (Msg.Sender) + { + case Sender_Kernel: + { + Msg.Sender = Sender_Camera; + Msg.pData = chMsgBufCam; + xQueueSend(TaskParam_Camera.QueueHandles.hxq_Kernel, &Msg, MS(10)); + } + default: {;} /* for the time being we ignore messages received from + someone other than the kernel. */ + } } } } -- cgit v1.2.3