-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvars.h
167 lines (137 loc) · 4.78 KB
/
vars.h
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
/*u-osd - A simple open source osd for G-OSD
Copyright (C) 2013 Alex Maximchuk
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef VARS_H_
#define VARS_H_
// Key
static u8 g_key_pressed = 0;
static u8 g_key_press_time = 0;
// ADC
static u16 g_adc_raw[ANALOG_IN_NUMBERS];
static u8 g_adc_scale[ANALOG_IN_NUMBERS] = {ANALOG_IN_SCALE};
#ifdef SENSOR_BATTERY_PERCENTAGE_ENABLED
static u8 g_sensor_battery_percentage = 0;
#endif // SENSOR_BATTERY_PERCENTAGE_ENABLED
#ifdef SENSOR_RSSI_ENABLED
static u8 g_sensor_rssi = 0;
#endif // SENSOR_RSSI_ENABLED
static TAnalogValue g_sensor_voltage1;
static TAnalogValue g_sensor_voltage2;
#ifdef SENSOR_CURRENT_ENABLED
static u32 g_sensor_power_usage= 0;
static TAnalogValue g_sensor_current;
#endif // SENSOR_CURRENT_ENABLED
#ifdef SENSOR_COMPASS_ENABLED
static u8 g_sensor_compass_direction = 0;
#endif // SENSOR_COMPASS_ENABLED
// Time
static volatile u8 g_time_tick = 0;
static volatile TTime g_time = {};
static volatile u8 g_blink = 0;
// Stats
static volatile u16 g_stat_dist_traveled= 0;
static volatile u8 g_stat_max_speed = 0;
static volatile s16 g_stat_max_altitude = 0;
static volatile u16 g_stat_max_distance = 0;
// GPS
static TGpsData g_gps_valid_data;
static TGpsData g_gps_data;
static TGpsPos g_gps_stat_pos;
static BOOL g_gps_stat_set = 0;
static u8 g_gps_stat_packet = 0;
#ifdef DEBUG_TEXT
static u16 g_gps_packets_bad = 0;
static u16 g_gps_packets_total = 0;
#endif //DEBUG_TEXT
static u32 g_home_distance = 0; // Distance to home
static u16 g_home_bearing = 0; // Direction to home
static TGpsPos g_home_pos;
static u8 g_home_set = 0;
#ifdef HOME_SET_AT_FIX
static u8 g_home_fix_count = 0;
#endif //HOME_SET_AT_FIX
// Text & Layout
static volatile u8 g_frame_sync = 0;
static u8 g_active_line = 0;
static u8 g_skip_line = 0;
// rows
static u8 g_text_row;
static str_row g_text_rows[TEXT_ROWS] = {
#ifdef COLORSYSTEM_NTSC
{0, ""},
{12, ""},
{TEXT_RADAR_LINE-6*8, ""},
{TEXT_RADAR_LINE-5*8, ""},
{TEXT_RADAR_LINE-4*8, ""},
{TEXT_RADAR_LINE-3*8, ""},
{TEXT_RADAR_LINE-2*8, ""},
{TEXT_RADAR_LINE-1*8, ""},
{TEXT_RADAR_LINE+0*8, ""},
{TEXT_RADAR_LINE+1*8, ""},
{TEXT_RADAR_LINE+2*8, ""},
{TEXT_RADAR_LINE+3*8, ""},
{TEXT_RADAR_LINE+4*8, ""},
{TEXT_RADAR_LINE+5*8, ""},
{191, ""},
{203, ""},
{215, ""},
#else // PAL
{0, ""},
{12, ""},
{TEXT_RADAR_LINE-6*8, ""},
{TEXT_RADAR_LINE-5*8, ""},
{TEXT_RADAR_LINE-4*8, ""},
{TEXT_RADAR_LINE-3*8, ""},
{TEXT_RADAR_LINE-2*8, ""},
{TEXT_RADAR_LINE-1*8, ""},
{TEXT_RADAR_LINE+0*8, ""},
{TEXT_RADAR_LINE+1*8, ""},
{TEXT_RADAR_LINE+2*8, ""},
{TEXT_RADAR_LINE+3*8, ""},
{TEXT_RADAR_LINE+4*8, ""},
{TEXT_RADAR_LINE+5*8, ""},
{222, ""},
{234, ""},
{246, ""},
#endif
};
static str_text g_text_sign = {{0, 1 }, {16,1}};
static str_text g_text_volt1 = {{0, 14 }, {7, 1}};
static str_text g_text_volt2 = {{0, 15 }, {7, 1}};
static str_text g_text_time = {{0, 0 }, {6, 1}};
static str_text g_text_alt = {{30, 8 }, {5, 1}};
static str_text g_text_speed = {{1, 8 }, {4, 1}};
static str_text g_text_lat = {{0, 16 }, {11,1}};
static str_text g_text_lon = {{23, 16 }, {12,1}};
static str_text g_text_sat = {{30, 0 }, {4, 1}};
static str_text g_text_bear_to_home = {{15, 15 }, {5, 1}};
static str_text g_text_dist_to_home = {{15, 16 }, {6, 1}};
static str_scale g_text_speed_scale = {{5, 2 }, 0};
static str_scale g_text_alt_scale = {{29, 2 }, 0};
static str_radar g_text_radar = {{17, 8 }, {15,8}};
static str_text g_text_home = {{17, 14 }, {1, 1}};
#ifdef SENSOR_RSSI_ENABLED
static str_text g_text_rssi = {{30, 1 }, {5, 1}};
#endif // SENSOR_RSSI_ENABLED
#ifdef STATS_ENABLED
static str_text g_text_stat_max_speed = {{1, 2 }, {3, 1}};
static str_text g_text_stat_max_dist = {{21, 0 }, {7, 1}};
static str_text g_text_stat_trip = {{8, 0 }, {7, 1}};
static str_text g_text_stat_max_alt = {{31, 2 }, {4, 1}};
#endif // STATS_ENABLED
#ifdef SENSOR_CURRENT_ENABLED
static str_text g_text_current = {{27, 14 }, {7, 1}};
static str_text g_text_power_usage = {{27, 15 }, {8, 1}};
#endif // SENSOR_CURRENT_ENABLED
#endif /* VARS_H_ */