-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.cpp
More file actions
134 lines (88 loc) · 3.24 KB
/
Copy pathmain.cpp
File metadata and controls
134 lines (88 loc) · 3.24 KB
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
#include <Arduino.h>
#include <esp_partition.h>
#include "my_esp_gcs_config.h"
#include "esp_gcs_pfd.h"
#include "esp_gcs_adsb.h"
#include "esp_gcs_hsi.h"
#include <FT6236G.h>
// ESP_GCS_PFD pfd;
// ESP_GCS_ADSB adsb;
// ESP_GCS_HSI hsi;
ESP_GCS_SYSTEM sys;
esp_gcs_config_t config;
//ESP_GCS_DATALINK datalink;
// tasks definitions
static void task_events(void *pvParameters);
static void task_print_info(void *pvParameters);
// #############################################################################################################
// SETUP
// #############################################################################################################
void setup() {
config.display.type = PARALLEL_9488;
config.display.width = 480;
config.display.height = 320;
config.link = TCP;
config.protocol = ADSB_RAW;
config.network.ssid = WIFI_SSID;
config.network.password = WIFI_PASS;
config.network.ip = IPAddress(10,0,0,58);
config.network.port = 30002;
sys.init();
//datalink.init( &config );
//datalink.set_adsb_local_reference(18.4650, -69.9428); // for local CPR
// adsb.push_fb();
// xTaskCreate(
// adsb.task_system_events,
// "system_events_task",
// 1024*4,
// NULL,
// 4,
// NULL
// );
// xTaskCreate(
// adsb.task_touch_events,
// "touch_events_task",
// 1024*2,
// NULL,
// 5,
// &adsb.xHandleEventsTask
// );
// log_i("init datalink...");
// adsb.datalink.set_cpr_local_reference(18.4650, -69.9428); // for local CPR
// adsb.datalink.init( &config );
}
// #############################################################################################################
// LOOP
// #############################################################################################################
void loop() {
sys.push_fb();
}
// // #############################################################################################################
// // EVENT TASK
// // #############################################################################################################
// static void task_events(void *pvParameters) {
// log_d("EVENT TASK STARTED");
// int angle = 0;
// for(;;) {
// log_d("EVENT TASK RUNNING");
// adsb.fb_1.pushRotateZoom(&adsb.fb_0, 0, 1.0,1.0);
// angle += 5;
// if (angle >= 360) angle = 0;
// adsb.aircraft.pushRotateZoom(&adsb.fb_0, 130, 100, angle, 1.0, 1.0);
// adsb.push_fb();
// // Yield to other tasks
// vTaskDelay(100 / portTICK_PERIOD_MS);
// }
// }
// // #############################################################################################################
// // EVENT TASK
// // #############################################################################################################
// static void task_print_info(void *pvParameters) {
// log_d("DISPLAY INFO TASK STARTED");
// for(;;) {
// log_d("DISPLAY INFO TASK RUNNING");
// log_i("Free RAM: %.2f KB\n", ESP.getFreeHeap() / 1024.0);
// // Yield to other tasks
// vTaskDelay(5000 / portTICK_PERIOD_MS);
// }
// }