summaryrefslogtreecommitdiff
path: root/software/mpu/src/boot.c
blob: d3b4d59e0d9cce16e2c793defe46cbc788457137 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * 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);

/*
 * Globals */
static 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);

	/* Start the tasks. */
	vTaskStartScheduler();
}