-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
137 lines (92 loc) · 3.35 KB
/
main.c
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
* main.c
*
* Created on: 12. 12. 2023
* Author: vojtechlukas
*/
// === INCLUDES =================================================================================================
#include <stdint.h>
#include <xdc/std.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Memory.h>
#include <xdc/runtime/Error.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/BIOS.h>
#include <ti/drivers/Board.h>
#include <ti/sysbios/knl/Semaphore.h>
#include "ti_drivers_config.h"
#include "ti_radio_config.h"
#include <ti/drivers/GPIO.h>
#include <ti/drivers/I2C.h>
#include <source/oled_gui/gui.h>
#include <source/ethernet/Ethernet.h>
#include <dashboard_task.h>
#include <source/html/html.h>
#include <dashboard_task.h>
#include <init_task.h>
#include <sniffing_task.h>
#include <source/radio_api/radio_api.h_bak>
#include <source/utils/log.h>
// ==============================================================================================================
// === TASK CREATE FUNCTIONS ====================================================================================
/*
* === Initialization task
*/
Task_Handle initTaskHandle;
Task_Params initTaskParams;
void Main_CreateInitTask()
{
Task_Params_init(&initTaskParams);
initTaskParams.stackSize = 1024;
initTaskParams.priority = 3;
initTaskHandle = Task_create((Task_FuncPtr)Init_Main, &initTaskParams, Error_IGNORE);
return;
}
/*
* === Dashboard Task
*/
Task_Handle dashboardTaskHandle;
Task_Params dashboardTaskParams;
void Main_CreateDashboardTask()
{
Task_Params_init(&dashboardTaskParams);
dashboardTaskParams.stackSize = 4096;
dashboardTaskParams.priority = 3;
dashboardTaskHandle = Task_create((Task_FuncPtr)Dashboard_Main, &dashboardTaskParams, Error_IGNORE);
return;
}
/*
* === Sniffing Task
*/
Task_Handle sniffingTaskHandle;
Task_Params sniffingTaskParams;
void Main_CreateSniffingTask()
{
Task_Params_init(&sniffingTaskParams);
sniffingTaskParams.stackSize = 4096;
sniffingTaskParams.priority = 3;
sniffingTaskHandle = Task_create((Task_FuncPtr)Sniffing_Main, &sniffingTaskParams, Error_IGNORE);
return;
}
// ==============================================================================================================
// === SEMAPHORE STRUCTS ========================================================================================
Semaphore_Handle Init_SemaphoreHandle;
Semaphore_Params Init_SemaphoreParams;
Semaphore_Handle Dashboard_SemaphoreHandle; // <== TODO rename?
Semaphore_Params Dashboard_SemaphoreParams;
// ==============================================================================================================
// === PROGRAM ENTRY POINT ======================================================================================
int main()
{
Board_init();
Semaphore_Params_init(&Init_SemaphoreParams);
Init_SemaphoreParams.mode = Semaphore_Mode_BINARY;
Init_SemaphoreHandle = Semaphore_create(0, &Init_SemaphoreParams, NULL);
Semaphore_Params_init(&Dashboard_SemaphoreParams);
Dashboard_SemaphoreParams.mode = Semaphore_Mode_BINARY;
Dashboard_SemaphoreHandle = Semaphore_create(0, &Dashboard_SemaphoreParams, NULL);
Main_CreateInitTask();
BIOS_start();
return 0;
}
// ==============================================================================================================