Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / cms / cms_menu_osd.c
blobe99e0cc52f23b333f69a6b528ec89c65c2a42740
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Cleanflight is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
18 #include <stdbool.h>
19 #include <stdint.h>
20 #include <string.h>
22 #include "platform.h"
24 #if defined(USE_OSD) && defined(USE_CMS) && defined(CMS_MENU_OSD)
26 #include "build/debug.h"
28 #include "common/utils.h"
30 #include "cms/cms.h"
31 #include "cms/cms_types.h"
32 #include "cms/cms_menu_osd.h"
34 #include "fc/settings.h"
36 #include "io/osd.h"
38 #define OSD_ITEM_ENTRY(label, item_id) ((OSD_Entry){ label, {.itemId = item_id}, &cmsx_menuOsdElementActions, OME_Submenu, 0 })
40 static int osdCurrentLayout = -1;
41 static int osdCurrentItem = -1;
43 static uint8_t osdCurrentElementRow = 0;
44 static uint8_t osdCurrentElementColumn = 0;
45 static uint8_t osdCurrentElementVisible = 0;
47 static long osdElementsOnEnter(const OSD_Entry *from);
48 static long osdElementsOnExit(const OSD_Entry *from);
49 static long osdElemActionsOnEnter(const OSD_Entry *from);
51 static const OSD_Entry cmsx_menuAlarmsEntries[] = {
52 OSD_LABEL_ENTRY("--- ALARMS ---"),
54 OSD_SETTING_ENTRY("RSSI", SETTING_OSD_RSSI_ALARM),
55 OSD_SETTING_ENTRY("FLY TIME", SETTING_OSD_TIME_ALARM),
56 OSD_SETTING_ENTRY("MAX ALT", SETTING_OSD_ALT_ALARM),
57 OSD_SETTING_ENTRY("MAX DIST", SETTING_OSD_DIST_ALARM),
58 OSD_SETTING_ENTRY("MAX NEG ALT", SETTING_OSD_NEG_ALT_ALARM),
60 OSD_BACK_AND_END_ENTRY,
63 static const CMS_Menu cmsx_menuAlarms = {
64 #ifdef CMS_MENU_DEBUG
65 .GUARD_text = "MENUOSDA",
66 .GUARD_type = OME_MENU,
67 #endif
68 .onEnter = NULL,
69 .onExit = NULL,
70 .onGlobalExit = NULL,
71 .entries = cmsx_menuAlarmsEntries,
74 static long cmsx_osdElementOnChange(displayPort_t *displayPort, const void *ptr)
76 UNUSED(ptr);
78 uint16_t *pos = &osdLayoutsConfigMutable()->item_pos[osdCurrentLayout][osdCurrentItem];
79 *pos = OSD_POS(osdCurrentElementColumn, osdCurrentElementRow);
80 if (osdCurrentElementVisible) {
81 *pos |= OSD_VISIBLE_FLAG;
83 cmsYieldDisplay(displayPort, 500);
84 return 0;
87 static long osdElementPreview(displayPort_t *displayPort, const void *ptr)
89 UNUSED(ptr);
91 cmsYieldDisplay(displayPort, 2000);
93 return 0;
96 static const OSD_Entry menuOsdElemActionsEntries[] = {
98 OSD_BOOL_CALLBACK_ENTRY("ENABLED", cmsx_osdElementOnChange, &osdCurrentElementVisible),
99 OSD_UINT8_CALLBACK_ENTRY("ROW", cmsx_osdElementOnChange, (&(const OSD_UINT8_t){ &osdCurrentElementRow, 0, OSD_X(OSD_POS_MAX), 1 })),
100 OSD_UINT8_CALLBACK_ENTRY("COLUMN", cmsx_osdElementOnChange, (&(const OSD_UINT8_t){ &osdCurrentElementColumn, 0, OSD_Y(OSD_POS_MAX), 1 })),
101 OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
103 OSD_BACK_AND_END_ENTRY,
106 static const OSD_Entry menuOsdFixedElemActionsEntries[] = {
108 OSD_BOOL_CALLBACK_ENTRY("ENABLED", cmsx_osdElementOnChange, &osdCurrentElementVisible),
109 OSD_FUNC_CALL_ENTRY("PREVIEW", osdElementPreview),
111 OSD_BACK_AND_END_ENTRY,
114 static CMS_Menu cmsx_menuOsdElementActions = {
115 #ifdef CMS_MENU_DEBUG
116 .GUARD_text = "MENUOSDELEM",
117 .GUARD_type = OME_MENU,
118 #endif
119 .onEnter = osdElemActionsOnEnter,
120 .onExit = NULL,
121 .onGlobalExit = NULL,
122 .entries = menuOsdElemActionsEntries,
125 static long osdElemActionsOnEnter(const OSD_Entry *from)
127 osdCurrentItem = from->itemId;
128 uint16_t pos = osdLayoutsConfig()->item_pos[osdCurrentLayout][osdCurrentItem];
129 osdCurrentElementColumn = OSD_X(pos);
130 osdCurrentElementRow = OSD_Y(pos);
131 osdCurrentElementVisible = OSD_VISIBLE(pos) ? 1 : 0;
132 if (osdItemIsFixed(osdCurrentItem)) {
133 cmsx_menuOsdElementActions.entries = menuOsdFixedElemActionsEntries;
134 } else {
135 cmsx_menuOsdElementActions.entries = menuOsdElemActionsEntries;
137 return 0;
140 #define OSD_ELEMENT_ENTRY(name, osd_item_id) OSD_ITEM_ENTRY(name, osd_item_id)
142 static const OSD_Entry menuCrsfRxEntries[]=
144 OSD_LABEL_ENTRY("-- CRSF RX --"),
146 OSD_SETTING_ENTRY("LQ FORMAT", SETTING_OSD_CRSF_LQ_FORMAT),
147 OSD_SETTING_ENTRY("LQ ALARM LEVEL", SETTING_OSD_LINK_QUALITY_ALARM),
148 OSD_SETTING_ENTRY("SNR ALARM LEVEL", SETTING_OSD_SNR_ALARM),
149 OSD_SETTING_ENTRY("RX SENSITIVITY", SETTING_OSD_RSSI_DBM_MIN),
150 OSD_ELEMENT_ENTRY("RX RSSI DBM", OSD_CRSF_RSSI_DBM),
151 OSD_ELEMENT_ENTRY("RX LQ", OSD_CRSF_LQ),
152 OSD_ELEMENT_ENTRY("RX SNR ALARM", OSD_CRSF_SNR_DB),
153 OSD_ELEMENT_ENTRY("TX POWER", OSD_CRSF_TX_POWER),
155 OSD_BACK_AND_END_ENTRY,
158 const CMS_Menu cmsx_menuCrsf = {
159 #ifdef CMS_MENU_DEBUG
160 .GUARD_text = "MENUCRF",
161 .GUARD_type = OME_MENU,
162 #endif
163 .onEnter = NULL,
164 .onExit = NULL,
165 .onGlobalExit = NULL,
166 .entries = menuCrsfRxEntries,
169 static const OSD_Entry menuOsdElemsEntries[] =
171 OSD_LABEL_ENTRY("--- OSD ITEMS ---"),
173 OSD_ELEMENT_ENTRY("RSSI", OSD_RSSI_VALUE),
174 #ifdef USE_SERIALRX_CRSF
175 OSD_SUBMENU_ENTRY("CRSF RX", &cmsx_menuCrsf),
176 #endif // CRSF Menu
177 OSD_ELEMENT_ENTRY("MAIN BATTERY", OSD_MAIN_BATT_VOLTAGE),
178 OSD_ELEMENT_ENTRY("MAIN BATT SC", OSD_SAG_COMPENSATED_MAIN_BATT_VOLTAGE),
179 OSD_ELEMENT_ENTRY("CELL VOLTAGE", OSD_MAIN_BATT_CELL_VOLTAGE),
180 OSD_ELEMENT_ENTRY("CELL VOLT. SC", OSD_MAIN_BATT_SAG_COMPENSATED_CELL_VOLTAGE),
181 OSD_ELEMENT_ENTRY("BAT IMPEDANCE", OSD_POWER_SUPPLY_IMPEDANCE),
182 OSD_ELEMENT_ENTRY("CROSSHAIRS", OSD_CROSSHAIRS),
183 OSD_ELEMENT_ENTRY("HORIZON", OSD_ARTIFICIAL_HORIZON),
184 OSD_ELEMENT_ENTRY("HORIZON SIDEBARS", OSD_HORIZON_SIDEBARS),
185 OSD_ELEMENT_ENTRY("ON TIME", OSD_ONTIME),
186 OSD_ELEMENT_ENTRY("FLY TIME", OSD_FLYTIME),
187 OSD_ELEMENT_ENTRY("ON/FLY TIME", OSD_ONTIME_FLYTIME),
188 OSD_ELEMENT_ENTRY("REM. TIME", OSD_REMAINING_FLIGHT_TIME_BEFORE_RTH),
189 OSD_ELEMENT_ENTRY("REM. DIST", OSD_REMAINING_DISTANCE_BEFORE_RTH),
190 OSD_ELEMENT_ENTRY("TIME (HOUR)", OSD_RTC_TIME),
191 OSD_ELEMENT_ENTRY("FLY MODE", OSD_FLYMODE),
192 OSD_ELEMENT_ENTRY("NAME", OSD_CRAFT_NAME),
193 OSD_ELEMENT_ENTRY("THR. ", OSD_THROTTLE_POS),
194 OSD_ELEMENT_ENTRY("THR. (SCALED)", OSD_SCALED_THROTTLE_POS),
195 OSD_ELEMENT_ENTRY("SYS MESSAGES", OSD_MESSAGES),
196 OSD_ELEMENT_ENTRY("VTX CHAN", OSD_VTX_CHANNEL),
197 OSD_ELEMENT_ENTRY("CURRENT (A)", OSD_CURRENT_DRAW),
198 OSD_ELEMENT_ENTRY("POWER", OSD_POWER),
199 OSD_ELEMENT_ENTRY("USED MAH", OSD_MAH_DRAWN),
200 OSD_ELEMENT_ENTRY("USED WH", OSD_WH_DRAWN),
201 OSD_ELEMENT_ENTRY("EFF/KM (AH)", OSD_EFFICIENCY_MAH_PER_KM),
202 OSD_ELEMENT_ENTRY("EFF/KM (WH)", OSD_EFFICIENCY_WH_PER_KM),
203 OSD_ELEMENT_ENTRY("BATT CAP REM", OSD_BATTERY_REMAINING_CAPACITY),
204 OSD_ELEMENT_ENTRY("BATT % REM", OSD_BATTERY_REMAINING_PERCENT),
205 #ifdef USE_GPS
206 OSD_ELEMENT_ENTRY("HOME DIR", OSD_HOME_DIR),
207 OSD_ELEMENT_ENTRY("HOME HEAD. ERR", OSD_HOME_HEADING_ERROR),
208 OSD_ELEMENT_ENTRY("HOME DIST", OSD_HOME_DIST),
209 OSD_ELEMENT_ENTRY("TRIP DIST", OSD_TRIP_DIST),
210 OSD_ELEMENT_ENTRY("GPS SPEED", OSD_GPS_SPEED),
211 OSD_ELEMENT_ENTRY("GPS SATS", OSD_GPS_SATS),
212 OSD_ELEMENT_ENTRY("GPS LAT", OSD_GPS_LAT),
213 OSD_ELEMENT_ENTRY("GPS LON", OSD_GPS_LON),
214 OSD_ELEMENT_ENTRY("GPS HDOP", OSD_GPS_HDOP),
215 OSD_ELEMENT_ENTRY("3D SPEED", OSD_3D_SPEED),
216 OSD_ELEMENT_ENTRY("PLUS CODE", OSD_PLUS_CODE),
217 OSD_ELEMENT_ENTRY("AZIMUTH", OSD_AZIMUTH),
218 OSD_ELEMENT_ENTRY("GRD COURSE", OSD_GROUND_COURSE),
219 OSD_ELEMENT_ENTRY("X TRACK ERR", OSD_CROSS_TRACK_ERROR),
220 #endif // GPS
221 OSD_ELEMENT_ENTRY("HEADING", OSD_HEADING),
222 OSD_ELEMENT_ENTRY("HEADING GR.", OSD_HEADING_GRAPH),
223 OSD_ELEMENT_ENTRY("CRS HLD ERR", OSD_COURSE_HOLD_ERROR),
224 OSD_ELEMENT_ENTRY("CRS HLD ADJ", OSD_COURSE_HOLD_ADJUSTMENT),
225 #if defined(USE_BARO) || defined(USE_GPS)
226 OSD_ELEMENT_ENTRY("VARIO", OSD_VARIO),
227 OSD_ELEMENT_ENTRY("VARIO NUM", OSD_VARIO_NUM),
228 #endif // defined
229 OSD_ELEMENT_ENTRY("ALTITUDE", OSD_ALTITUDE),
230 OSD_ELEMENT_ENTRY("ALTITUDE MSL", OSD_ALTITUDE_MSL),
231 #if defined(USE_PITOT)
232 OSD_ELEMENT_ENTRY("AIR SPEED", OSD_AIR_SPEED),
233 #endif
234 #if defined(USE_GPS)
235 OSD_ELEMENT_ENTRY("MAP NORTH", OSD_MAP_NORTH),
236 OSD_ELEMENT_ENTRY("MAP TAKE OFF", OSD_MAP_TAKEOFF),
237 OSD_ELEMENT_ENTRY("RADAR", OSD_RADAR),
238 OSD_ELEMENT_ENTRY("MAP SCALE", OSD_MAP_SCALE),
239 OSD_ELEMENT_ENTRY("MAP REFERENCE", OSD_MAP_REFERENCE),
240 OSD_ELEMENT_ENTRY("FORMATION FLIGHT", OSD_FORMATION_FLIGHT),
241 #endif
242 OSD_ELEMENT_ENTRY("EXPO", OSD_RC_EXPO),
243 OSD_ELEMENT_ENTRY("YAW EXPO", OSD_RC_YAW_EXPO),
244 OSD_ELEMENT_ENTRY("THR EXPO", OSD_THROTTLE_EXPO),
245 OSD_ELEMENT_ENTRY("ROLL RATE", OSD_ROLL_RATE),
246 OSD_ELEMENT_ENTRY("PITCH RATE", OSD_PITCH_RATE),
247 OSD_ELEMENT_ENTRY("YAW RATE", OSD_YAW_RATE),
248 OSD_ELEMENT_ENTRY("M EXPO", OSD_MANUAL_RC_EXPO),
249 OSD_ELEMENT_ENTRY("M YAW EXPO", OSD_MANUAL_RC_YAW_EXPO),
250 OSD_ELEMENT_ENTRY("M ROLL RATE", OSD_MANUAL_ROLL_RATE),
251 OSD_ELEMENT_ENTRY("M PITCH RATE", OSD_MANUAL_PITCH_RATE),
252 OSD_ELEMENT_ENTRY("M YAW RATE", OSD_MANUAL_YAW_RATE),
253 OSD_ELEMENT_ENTRY("CRUISE THR", OSD_NAV_FW_CRUISE_THR),
254 OSD_ELEMENT_ENTRY("PITCH TO THR", OSD_NAV_FW_PITCH2THR),
255 OSD_ELEMENT_ENTRY("ROLL PIDS", OSD_ROLL_PIDS),
256 OSD_ELEMENT_ENTRY("PITCH PIDS", OSD_PITCH_PIDS),
257 OSD_ELEMENT_ENTRY("YAW PIDS", OSD_YAW_PIDS),
258 OSD_ELEMENT_ENTRY("LEVEL PIDS", OSD_LEVEL_PIDS),
259 OSD_ELEMENT_ENTRY("POSXY PIDS", OSD_POS_XY_PIDS),
260 OSD_ELEMENT_ENTRY("POSZ PIDS", OSD_POS_Z_PIDS),
261 OSD_ELEMENT_ENTRY("VELXY PIDS", OSD_VEL_XY_PIDS),
262 OSD_ELEMENT_ENTRY("VELZ PIDS", OSD_VEL_Z_PIDS),
263 OSD_ELEMENT_ENTRY("HEAD P", OSD_HEADING_P),
264 OSD_ELEMENT_ENTRY("ALIGN ROLL", OSD_BOARD_ALIGN_ROLL),
265 OSD_ELEMENT_ENTRY("ALIGN PITCH", OSD_BOARD_ALIGN_PITCH),
266 OSD_ELEMENT_ENTRY("0THR PITCH", OSD_FW_MIN_THROTTLE_DOWN_PITCH_ANGLE),
268 OSD_ELEMENT_ENTRY("FW ALT PID OUT", OSD_FW_ALT_PID_OUTPUTS),
269 OSD_ELEMENT_ENTRY("FW POS PID OUT", OSD_FW_POS_PID_OUTPUTS),
270 OSD_ELEMENT_ENTRY("MC VELX PID OUT", OSD_MC_VEL_X_PID_OUTPUTS),
271 OSD_ELEMENT_ENTRY("MC VELY PID OUT", OSD_MC_VEL_Y_PID_OUTPUTS),
272 OSD_ELEMENT_ENTRY("MC VELZ PID OUT", OSD_MC_VEL_Z_PID_OUTPUTS),
273 OSD_ELEMENT_ENTRY("MC POS PID OUT", OSD_MC_POS_XYZ_P_OUTPUTS),
275 OSD_ELEMENT_ENTRY("ATTI PITCH", OSD_ATTITUDE_PITCH),
276 OSD_ELEMENT_ENTRY("ATTI ROLL", OSD_ATTITUDE_ROLL),
278 OSD_ELEMENT_ENTRY("WIND HOR", OSD_WIND_SPEED_HORIZONTAL),
279 OSD_ELEMENT_ENTRY("WIND VERT", OSD_WIND_SPEED_VERTICAL),
281 OSD_ELEMENT_ENTRY("G-FORCE", OSD_GFORCE),
282 OSD_ELEMENT_ENTRY("G-FORCE X", OSD_GFORCE_X),
283 OSD_ELEMENT_ENTRY("G-FORCE Y", OSD_GFORCE_Y),
284 OSD_ELEMENT_ENTRY("G-FORCE Z", OSD_GFORCE_Z),
286 OSD_ELEMENT_ENTRY("VTX POWER", OSD_VTX_POWER),
288 #if defined(USE_RX_MSP) && defined(USE_MSP_RC_OVERRIDE)
289 OSD_ELEMENT_ENTRY("RC SOURCE", OSD_RC_SOURCE),
290 #endif
292 OSD_ELEMENT_ENTRY("IMU TEMP", OSD_IMU_TEMPERATURE),
293 #ifdef USE_BARO
294 OSD_ELEMENT_ENTRY("BARO TEMP", OSD_BARO_TEMPERATURE),
295 #endif
297 #ifdef USE_TEMPERATURE_SENSOR
298 OSD_ELEMENT_ENTRY("SENSOR 0 TEMP", OSD_TEMP_SENSOR_0_TEMPERATURE),
299 OSD_ELEMENT_ENTRY("SENSOR 1 TEMP", OSD_TEMP_SENSOR_1_TEMPERATURE),
300 OSD_ELEMENT_ENTRY("SENSOR 2 TEMP", OSD_TEMP_SENSOR_2_TEMPERATURE),
301 OSD_ELEMENT_ENTRY("SENSOR 3 TEMP", OSD_TEMP_SENSOR_3_TEMPERATURE),
302 OSD_ELEMENT_ENTRY("SENSOR 4 TEMP", OSD_TEMP_SENSOR_4_TEMPERATURE),
303 OSD_ELEMENT_ENTRY("SENSOR 5 TEMP", OSD_TEMP_SENSOR_5_TEMPERATURE),
304 OSD_ELEMENT_ENTRY("SENSOR 6 TEMP", OSD_TEMP_SENSOR_6_TEMPERATURE),
305 OSD_ELEMENT_ENTRY("SENSOR 7 TEMP", OSD_TEMP_SENSOR_7_TEMPERATURE),
306 #endif
308 OSD_ELEMENT_ENTRY("GVAR 0", OSD_GVAR_0),
309 OSD_ELEMENT_ENTRY("GVAR 1", OSD_GVAR_1),
310 OSD_ELEMENT_ENTRY("GVAR 2", OSD_GVAR_2),
311 OSD_ELEMENT_ENTRY("GVAR 3", OSD_GVAR_3),
313 OSD_ELEMENT_ENTRY("TPA", OSD_TPA),
314 OSD_ELEMENT_ENTRY("FW CTRL SMOOTH", OSD_NAV_FW_CONTROL_SMOOTHNESS),
315 OSD_ELEMENT_ENTRY("VERSION", OSD_VERSION),
316 OSD_ELEMENT_ENTRY("RANGEFINDER", OSD_RANGEFINDER),
318 #ifdef USE_ESC_SENSOR
319 OSD_ELEMENT_ENTRY("ESC RPM", OSD_ESC_RPM),
320 OSD_ELEMENT_ENTRY("ESC TEMPERATURE", OSD_ESC_TEMPERATURE),
321 #endif
323 #ifdef USE_POWER_LIMITS
324 OSD_ELEMENT_ENTRY("PLIM BURST TIME", OSD_PLIMIT_REMAINING_BURST_TIME),
325 OSD_ELEMENT_ENTRY("PLIM CURR LIMIT", OSD_PLIMIT_ACTIVE_CURRENT_LIMIT),
326 #ifdef USE_ADC
327 OSD_ELEMENT_ENTRY("PLIM POWER LIMIT", OSD_PLIMIT_ACTIVE_POWER_LIMIT),
328 #endif // USE_ADC
329 #endif // USE_POWER_LIMITS
331 OSD_BACK_AND_END_ENTRY,
334 const CMS_Menu menuOsdElements = {
335 #ifdef CMS_MENU_DEBUG
336 .GUARD_text = "MENUOSDE",
337 .GUARD_type = OME_MENU,
338 #endif
339 .onEnter = osdElementsOnEnter,
340 .onExit = osdElementsOnExit,
341 .onGlobalExit = NULL,
342 .entries = menuOsdElemsEntries,
346 #define OSD_LAYOUT_SUBMENU_ENTRY(label) OSD_SUBMENU_ENTRY(label, &menuOsdElements)
348 static const OSD_Entry cmsx_menuOsdLayoutEntries[] =
350 OSD_LABEL_ENTRY("---SCREEN LAYOUT---"),
352 OSD_LAYOUT_SUBMENU_ENTRY("DEFAULT"),
353 #if OSD_ALTERNATE_LAYOUT_COUNT > 0
354 OSD_LAYOUT_SUBMENU_ENTRY("ALTERNATE 1"),
355 #if OSD_ALTERNATE_LAYOUT_COUNT > 1
356 OSD_LAYOUT_SUBMENU_ENTRY("ALTERNATE 2"),
357 #if OSD_ALTERNATE_LAYOUT_COUNT > 2
358 OSD_LAYOUT_SUBMENU_ENTRY("ALTERNATE 3"),
359 #endif
360 #endif
361 #endif
363 OSD_BACK_AND_END_ENTRY,
366 const CMS_Menu cmsx_menuOsdLayout = {
367 #ifdef CMS_MENU_DEBUG
368 .GUARD_text = "MENUOSDL",
369 .GUARD_type = OME_MENU,
370 #endif
371 .onEnter = NULL,
372 .onExit = NULL,
373 .onGlobalExit = NULL,
374 .entries = cmsx_menuOsdLayoutEntries,
377 static long osdElementsOnEnter(const OSD_Entry *from)
379 // First entry is the label. Store the current layout
380 // and override it on the OSD so previews so this layout.
381 osdCurrentLayout = from - cmsx_menuOsdLayoutEntries - 1;
382 osdOverrideLayout(osdCurrentLayout, 0);
383 return 0;
386 static long osdElementsOnExit(const OSD_Entry *from)
388 UNUSED(from);
390 // Stop overriding OSD layout
391 osdOverrideLayout(-1, 0);
392 return 0;
395 static const OSD_Entry menuOsdSettingsEntries[] = {
396 OSD_LABEL_ENTRY("--- OSD SETTINGS ---"),
398 OSD_SETTING_ENTRY("VOLT. DECIMALS", SETTING_OSD_MAIN_VOLTAGE_DECIMALS),
399 OSD_SETTING_ENTRY("COORD. DIGITS", SETTING_OSD_COORDINATE_DIGITS),
400 OSD_SETTING_ENTRY("LEFT SCROLL", SETTING_OSD_LEFT_SIDEBAR_SCROLL),
401 OSD_SETTING_ENTRY("RIGHT SCROLL", SETTING_OSD_RIGHT_SIDEBAR_SCROLL),
402 OSD_SETTING_ENTRY("SCROLL ARROWS", SETTING_OSD_SIDEBAR_SCROLL_ARROWS),
404 OSD_BACK_AND_END_ENTRY,
407 static const CMS_Menu cmsx_menuOsdSettings = {
408 #ifdef CMS_MENU_DEBUG
409 .GUARD_text = "MENUOSDS",
410 .GUARD_type = OME_MENU,
411 #endif
412 .onEnter = NULL,
413 .onExit = NULL,
414 .onGlobalExit = NULL,
415 .entries = menuOsdSettingsEntries,
418 static const OSD_Entry menuOsdHud2Entries[] = {
419 OSD_LABEL_ENTRY("--- HUD ITEMS ---"),
421 OSD_SETTING_ENTRY("HOMING ARROWS", SETTING_OSD_HUD_HOMING),
422 OSD_SETTING_ENTRY("HOME POINT", SETTING_OSD_HUD_HOMEPOINT),
423 OSD_SETTING_ENTRY("RADAR MAX AIRCRAFT", SETTING_OSD_HUD_RADAR_DISP),
424 OSD_SETTING_ENTRY("RADAR MIN RANGE", SETTING_OSD_HUD_RADAR_RANGE_MIN),
425 OSD_SETTING_ENTRY("RADAR MAX RANGE", SETTING_OSD_HUD_RADAR_RANGE_MAX),
426 OSD_SETTING_ENTRY("NEXT WAYPOINTS", SETTING_OSD_HUD_WP_DISP),
427 OSD_BACK_ENTRY,
428 OSD_END_ENTRY,
431 static const CMS_Menu cmsx_menuOsdHud2 = {
432 #ifdef CMS_MENU_DEBUG
433 .GUARD_text = "MENUOSDH2",
434 .GUARD_type = OME_MENU,
435 #endif
436 .onEnter = NULL,
437 .onExit = NULL,
438 .onGlobalExit = NULL,
439 .entries = menuOsdHud2Entries,
442 static const OSD_Entry menuOsdHudEntries[] = {
443 OSD_LABEL_ENTRY("--- HUD ---"),
445 OSD_SETTING_ENTRY("CROSSHAIRS STYLE", SETTING_OSD_CROSSHAIRS_STYLE),
446 OSD_SETTING_ENTRY("HORIZON OFFSET", SETTING_OSD_HORIZON_OFFSET),
447 OSD_SETTING_ENTRY("CAMERA UPTILT", SETTING_OSD_CAMERA_UPTILT),
448 OSD_SETTING_ENTRY("CAMERA FOV HORI", SETTING_OSD_CAMERA_FOV_H),
449 OSD_SETTING_ENTRY("CAMERA FOV VERT", SETTING_OSD_CAMERA_FOV_V),
450 OSD_SETTING_ENTRY("HUD MARGIN HORI", SETTING_OSD_HUD_MARGIN_H),
451 OSD_SETTING_ENTRY("HUD MARGIN VERT", SETTING_OSD_HUD_MARGIN_V),
452 OSD_SUBMENU_ENTRY("DISPLAYED ITEMS", &cmsx_menuOsdHud2),
454 OSD_BACK_ENTRY,
455 OSD_END_ENTRY,
458 #ifdef USE_CMS_FONT_PREVIEW
460 static const OSD_Entry menuOsdFontPage1Entries[] = {
461 OSD_LABEL_ENTRY("FONT: 0123456789ABCDEF"),
462 OSD_LABEL_ENTRY(" 00: \x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"),
463 OSD_LABEL_ENTRY(" 10: \x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"),
464 OSD_LABEL_ENTRY(" 20: \x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"),
465 OSD_LABEL_ENTRY(" 30: \x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"),
466 OSD_LABEL_ENTRY(" 40: \x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F"),
467 OSD_LABEL_ENTRY(" 50: \x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F"),
468 OSD_LABEL_ENTRY(" 60: \x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F"),
469 OSD_LABEL_ENTRY(" 70: \x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F"),
470 OSD_LABEL_ENTRY(" 80: \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F"),
471 OSD_LABEL_ENTRY(" 90: \x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F"),
472 OSD_LABEL_ENTRY(" A0: \xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF"),
473 OSD_LABEL_ENTRY(" B0: \xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF"),
474 OSD_LABEL_ENTRY(" C0: \xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF"),
475 OSD_LABEL_ENTRY(" "),
476 OSD_LABEL_ENTRY(" "),
477 OSD_LABEL_ENTRY(" "),
478 OSD_LABEL_ENTRY("FONT: 0123456789ABCDEF"),
479 OSD_LABEL_ENTRY(" D0: \xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF"),
480 OSD_LABEL_ENTRY(" E0: \xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEE"),
481 OSD_LABEL_ENTRY(" F0: \xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"),
483 OSD_BACK_ENTRY,
484 OSD_END_ENTRY,
487 static const OSD_Entry menuOsdFontPage2Entries[] = {
488 OSD_LABEL_ENTRY( "FONT: 0123456789ABCDEF"),
489 OSD_LABEL_PAGE2_ENTRY(" 00: ", "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\0"),
490 OSD_LABEL_PAGE2_ENTRY(" 10: ", "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\0"),
491 OSD_LABEL_PAGE2_ENTRY(" 20: ", "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\0"),
492 OSD_LABEL_PAGE2_ENTRY(" 30: ", "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F\0"),
493 OSD_LABEL_PAGE2_ENTRY(" 40: ", "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4A\x4B\x4C\x4D\x4E\x4F\0"),
494 OSD_LABEL_PAGE2_ENTRY(" 50: ", "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5A\x5B\x5C\x5D\x5E\x5F\0"),
495 OSD_LABEL_PAGE2_ENTRY(" 60: ", "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6A\x6B\x6C\x6D\x6E\x6F\0"),
496 OSD_LABEL_PAGE2_ENTRY(" 70: ", "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7A\x7B\x7C\x7D\x7E\x7F\0"),
497 OSD_LABEL_PAGE2_ENTRY(" 80: ", "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\0"),
498 OSD_LABEL_PAGE2_ENTRY(" 90: ", "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\0"),
499 OSD_LABEL_PAGE2_ENTRY(" A0: ", "\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\0"),
500 OSD_LABEL_PAGE2_ENTRY(" B0: ", "\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\0"),
501 OSD_LABEL_PAGE2_ENTRY(" C0: ", "\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\0"),
502 OSD_LABEL_ENTRY(" "),
503 OSD_LABEL_ENTRY(" "),
504 OSD_LABEL_ENTRY(" "),
505 OSD_LABEL_ENTRY( "FONT: 0123456789ABCDEF"),
506 OSD_LABEL_PAGE2_ENTRY(" D0: ", "\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\0"),
507 OSD_LABEL_PAGE2_ENTRY(" E0: ", "\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEE\0"),
508 OSD_LABEL_PAGE2_ENTRY(" F0: ", "\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF\0"),
509 OSD_LABEL_ENTRY(" "),
511 OSD_BACK_ENTRY,
512 OSD_END_ENTRY,
516 static const CMS_Menu cmsx_menuOsdFontPage1 = {
517 #ifdef CMS_MENU_DEBUG
518 .GUARD_text = "MENUOSDFONTP1",
519 .GUARD_type = OME_MENU,
520 #endif
521 .onEnter = NULL,
522 .onExit = NULL,
523 .onGlobalExit = NULL,
524 .entries = menuOsdFontPage1Entries,
527 static const CMS_Menu cmsx_menuOsdFontPage2 = {
528 #ifdef CMS_MENU_DEBUG
529 .GUARD_text = "MENUOSDFONTP2",
530 .GUARD_type = OME_MENU,
531 #endif
532 .onEnter = NULL,
533 .onExit = NULL,
534 .onGlobalExit = NULL,
535 .entries = menuOsdFontPage2Entries,
538 static const OSD_Entry menuOsdFontEntries[] = {
539 OSD_LABEL_ENTRY("--- FONT ---"),
540 OSD_SUBMENU_ENTRY("PAGE 1", &cmsx_menuOsdFontPage1),
541 OSD_SUBMENU_ENTRY("PAGE 2", &cmsx_menuOsdFontPage2),
543 OSD_BACK_ENTRY,
544 OSD_END_ENTRY,
547 static const CMS_Menu cmsx_menuFont = {
548 #ifdef CMS_MENU_DEBUG
549 .GUARD_text = "MENUFONT",
550 .GUARD_type = OME_MENU,
551 #endif
552 .onEnter = NULL,
553 .onExit = NULL,
554 .onGlobalExit = NULL,
555 .entries = menuOsdFontEntries,
558 #endif // USE_CMS_FONT_PREVIEW
560 static const CMS_Menu cmsx_menuOsdHud = {
561 #ifdef CMS_MENU_DEBUG
562 .GUARD_text = "MENUOSDH",
563 .GUARD_type = OME_MENU,
564 #endif
565 .onEnter = NULL,
566 .onExit = NULL,
567 .onGlobalExit = NULL,
568 .entries = menuOsdHudEntries,
571 static const OSD_Entry menuOsdEntries[] = {
572 OSD_LABEL_ENTRY("--- OSD ---"),
574 OSD_SUBMENU_ENTRY("LAYOUTS", &cmsx_menuOsdLayout),
575 OSD_SUBMENU_ENTRY("SETTINGS", &cmsx_menuOsdSettings),
576 OSD_SUBMENU_ENTRY("ALARMS", &cmsx_menuAlarms),
577 OSD_SUBMENU_ENTRY("HUD", &cmsx_menuOsdHud),
578 #ifdef USE_CMS_FONT_PREVIEW
579 OSD_SUBMENU_ENTRY("FONT", &cmsx_menuFont),
580 #endif
582 OSD_BACK_AND_END_ENTRY,
586 const CMS_Menu cmsx_menuOsd = {
587 #ifdef CMS_MENU_DEBUG
588 .GUARD_text = "MENUOSD",
589 .GUARD_type = OME_MENU,
590 #endif
591 .onEnter = NULL,
592 .onExit = NULL,
593 .onGlobalExit = NULL,
594 .entries = menuOsdEntries,
597 #endif // CMS