diff --git a/radio/src/datastructs.h b/radio/src/datastructs.h index 60df2f96c..92158b409 100644 --- a/radio/src/datastructs.h +++ b/radio/src/datastructs.h @@ -346,11 +346,6 @@ PACK(struct FrSkyTelemetryData { }); #endif -/* - * MAVLINK Telemetry structure - */ - - /* * Telemetry Sensor structure */ diff --git a/radio/src/gui/128x64/menus.h b/radio/src/gui/128x64/menus.h index 18459bb5e..407b7dfd3 100644 --- a/radio/src/gui/128x64/menus.h +++ b/radio/src/gui/128x64/menus.h @@ -67,7 +67,6 @@ void onMainViewMenu(const char * result); void menuFirstCalib(event_t event); void menuMainView(event_t event); void menuViewTelemetryFrsky(event_t event); -void menuViewTelemetryMavlink(event_t event); void menuSpecialFunctions(event_t event, CustomFunctionData * functions, CustomFunctionsContext * functionsContext); enum MenuRadioIndexes @@ -121,7 +120,6 @@ enum MenuModelIndexes { MENU_MODEL_CUSTOM_SCRIPTS, #endif CASE_FRSKY(MENU_MODEL_TELEMETRY_FRSKY) - CASE_MAVLINK(MENU_MODEL_TELEMETRY_MAVLINK) MENU_MODEL_DISPLAY, CASE_TEMPLATES(MENU_MODEL_TEMPLATES) MENU_MODEL_PAGES_COUNT @@ -143,7 +141,6 @@ void menuModelLogicalSwitches(event_t event); void menuModelSpecialFunctions(event_t event); void menuModelCustomScripts(event_t event); void menuModelTelemetryFrsky(event_t event); -void menuModelTelemetryMavlink(event_t event); void menuModelDisplay(event_t event); void menuModelTemplates(event_t event); void menuModelGVarOne(event_t event); @@ -163,7 +160,6 @@ static const MenuHandlerFunc menuTabModel[] PROGMEM = { menuModelCustomScripts, #endif CASE_FRSKY(menuModelTelemetryFrsky) - CASE_MAVLINK(menuModelTelemetryMavlink) menuModelDisplay, CASE_TEMPLATES(menuModelTemplates) }; diff --git a/radio/src/gui/128x64/radio_setup.cpp b/radio/src/gui/128x64/radio_setup.cpp index ae13627d0..33ce9f24a 100644 --- a/radio/src/gui/128x64/radio_setup.cpp +++ b/radio/src/gui/128x64/radio_setup.cpp @@ -95,7 +95,6 @@ enum MenuRadioSetupItems { ITEM_SETUP_LANGUAGE, ITEM_SETUP_IMPERIAL, IF_FAI_CHOICE(ITEM_SETUP_FAI) - CASE_MAVLINK(ITEM_MAVLINK_BAUD) ITEM_SETUP_SWITCHES_DELAY, CASE_STM32(ITEM_SETUP_USB_MODE) ITEM_SETUP_RX_CHANNEL_ORD, @@ -132,7 +131,7 @@ void menuRadioSetup(event_t event) } #endif - MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_SETUP_MAX, { HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1) LABEL(SOUND), CASE_AUDIO(0) CASE_BUZZER(0) CASE_VOICE(0) 0, 0, 0, 0, CASE_AUDIO(0) CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_CAPACITY(0) CASE_PCBSKY9X(0) 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(0) 0, CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, CASE_STM32(0) 0, COL_TX_MODE, 0, 1/*to force edit mode*/}); + MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, HEADER_LINE+ITEM_SETUP_MAX, { HEADER_LINE_COLUMNS CASE_RTCLOCK(2) CASE_RTCLOCK(2) CASE_BATTGRAPH(1) LABEL(SOUND), CASE_AUDIO(0) CASE_BUZZER(0) CASE_VOICE(0) 0, 0, 0, 0, CASE_AUDIO(0) CASE_VARIO_CPUARM(LABEL(VARIO)) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_VARIO_CPUARM(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, CASE_CAPACITY(0) CASE_PCBSKY9X(0) 0, 0, 0, 0, IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_PWM_BACKLIGHT(0) CASE_PWM_BACKLIGHT(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(0) 0, CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) 0, CASE_STM32(0) 0, COL_TX_MODE, 0, 1/*to force edit mode*/}); if (event == EVT_ENTRY) { reusableBuffer.generalSettings.stickMode = g_eeGeneral.stickMode; diff --git a/radio/src/gui/128x64/view_mavlink.cpp b/radio/src/gui/128x64/view_mavlink.cpp deleted file mode 100644 index 1e07dedea..000000000 --- a/radio/src/gui/128x64/view_mavlink.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - */ - -/*! \file view_mavlink.cpp - * Mavlink menu - * Contains the menu specific code for Mavlink support. - */ - -#include "view_mavlink.h" - -#define VIEW_MAVLINK_2ND_COLUMN (LCD_W-6*FW-3) - -uint8_t MAVLINK_menu = MENU_INFO; - -/*! \brief Top Mavlink Menu definition - * \details Registers button events and handles that info. Buttons select menus, - * these are launched from the MAVLINK_menu switch statement. Setup menu is - * lanuched by the menu button. On exit (with exit button) the mavlink - * extension is reinitialized. - */ -void menuViewTelemetryMavlink(event_t event) { - - switch (event) // new event received, branch accordingly - { - case EVT_ENTRY: - MAVLINK_menu = MENU_INFO; - break; - - case EVT_KEY_FIRST(KEY_UP): - if (MAVLINK_menu > 0) - MAVLINK_menu--; - else - chainMenu(menuMainView); - break; - case EVT_KEY_FIRST(KEY_DOWN): - if (MAVLINK_menu < MAX_MAVLINK_MENU - 1) - MAVLINK_menu++; - break; - case EVT_KEY_FIRST(KEY_MENU): - return; - case EVT_KEY_FIRST(KEY_EXIT): - chainMenu(menuMainView); - break; - } - - switch (MAVLINK_menu) { - case MENU_INFO: - menuTelemetryMavlinkInfos(); - break; - case MENU_MODE: - menuTelemetryMavlinkFlightMode(); - break; - case MENU_BATT: - menuTelemetryMavlinkBattery(); - break; - case MENU_NAV: - menuTelemetryMavlinkNavigation(); - break; - case MENU_GPS: - menuTelemetryMavlinkGPS(); - break; -#ifdef DUMP_RX_TX - case MENU_DUMP_TX: - case MENU_DUMP_RX: - menuTelemetryMavlinkDump(event); - break; -#endif - default: - break; - } - -} - -/*! \brief Float variable display helper - * \param x x position on the screen - * \param y y position on the screen - * \param val value to display - * \param percis precision to display - * \param mode Use one of the defines in lcd.h line 81 - * \details The maximum value is 9999. The position is the position of the ones, see below for explanation "*" marks - * the x position. - * \verbatim - * - 9999.9999 \endverbatim - */ -void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode) { - char c; - int16_t lnum = val; - uint8_t x1 = x; - val -= lnum; - uint8_t xinc = FWNUM; - if (mode & DBLSIZE) - xinc *= 2; - - int8_t i = 0; - lnum = abs(lnum); - for (; i < 4; i++) { - c = (lnum % 10) + '0'; - x1 -= xinc; - lcdDrawChar(x1, y, c, mode); - lnum /= 10; - if (lnum == 0) { - break; - } - } - if (lnum != 0) { - // Error number too big - x1 = x; - for (i = 0; i < 4; i++) { - x1 -= FW; - lcdDrawChar(x1, y, '?', mode); - } - } else { - if (val < 0) { - val = -val; - x1 -= xinc; - lcdDrawChar(x1, y, '-', mode); - } - if (precis) - { - uint8_t y_temp = y; - if (mode & DBLSIZE) - y_temp += FH; - lcdDrawChar(x, y_temp, '.', (mode & (~DBLSIZE))); - x -= (xinc / 2); - } - for (i = 0; i < precis; i++) { - val *= 10; - int a = val; - c = a + '0'; - x += xinc; - lcdDrawChar(x, y, c, mode); - val -= a; - } - } -} - -/*! \brief Fightmode string printer - * \details Decodes the flight mode from Mavlink custom mode enum to a string. - * This funtion can handle ArduPilot and ArduCoper code. - * To support new autopilot pilots add a STR_MAVLINK_... to the translations, - * and if requred a lut (see arduplane for examle) if there are unused modes - * in the sequence. - */ - -void print_mav_mode(uint8_t x, uint8_t y, uint32_t custom_mode, uint8_t attr) //, const char * mode_text_p) -{ - uint8_t mode = (uint8_t) custom_mode; - switch (telemetry_data.type_autopilot) { - case MAVLINK_ARDUCOPTER: - lcdDrawTextAtIndex(x,y,STR_MAVLINK_AC_MODES,mode,attr); - break; - case MAVLINK_ARDUPLANE: - lcdDrawTextAtIndex(x,y,STR_MAVLINK_AP_MODES,ap_modes_lut[custom_mode],attr); - break; - default: - lcdDrawText (FW, y, PSTR("INV. MAV TYPE"), attr); - break; - } -} - -/*! \brief Menu header - * \details Small helper function to print the standard header on the screen. - */ -void mav_title(const pm_char * s, uint8_t index) -{ - lcdDrawText(0, 0, PSTR("MAVLINK"), INVERS); - lcdDrawText(10 * FW, 0, s); - drawScreenIndex(index, MAX_MAVLINK_MENU, INVERS); - lcdDrawChar(7 * FW, 0, (mav_heartbeat > 0) ? '*' : ' '); - if (telemetry_data.active) - lcdDrawChar(8 * FW, 0, 'A', BLINK); -} - -/*! \brief Global info menu - * \details Quick status overview menu. The menu should contain current mode, - * armed | disarmed, battery status and RSSI info. Menu must be clean and - * readable with a quick glance. - * \todo Make menu as described as above. - */ -void menuTelemetryMavlinkInfos(void) { - - mav_title(STR_MAVLINK_INFOS, MAVLINK_menu); - - uint8_t x1, x2, xnum, y; - x1 = FW; - x2 = 7 * FW; - xnum = x2 + 5 * FWNUM; - y = FH; -/* - char * ptr = mav_statustext; - for (uint8_t j = 0; j < LEN_STATUSTEXT; j++) { - if (*ptr == 0) { - lcdDrawChar(x1, y, ' '); - } else { - lcdDrawChar(x1, y, *ptr++); - } - x1 += FW; - } - x1 = FW; - y += FH; -*/ - if (telemetry_data.status) { - - lcdDrawSizedText(x1, y, STR_MAVLINK_MODE, 4, 0); - if (telemetry_data.active) - lcdDrawSizedText(x2, y, PSTR("A"), 1, 0); - lcdDrawNumber(xnum, y, telemetry_data.mode, 0); - - y += FH; - lcdDrawText(x1, y, PSTR("BATT")); - lcdDrawNumber(xnum, y, telemetry_data.vbat, PREC1, 5); - - y += FH; - lcdDrawText(x1, y, PSTR("DROP")); - lcdDrawNumber(xnum, y, telemetry_data.packet_drop, 0); -/* y += FH; - lcdDrawText(x1, y, PSTR("FIX")); - lcdDrawNumber(xnum, y, telemetry_data.packet_fixed, 0); - y += FH; - lcdDrawText(x1, y, PSTR("MAV Comp")); - lcdDrawNumber(xnum, y, telemetry_data.mav_compid, 0); - y += FH; - lcdDrawText(x1, y, PSTR("MAV Sys")); - lcdDrawNumber(xnum, y, telemetry_data.mav_sysid, 0); - y += FH; - lcdDrawText(x1, y, PSTR("Rad Comp")); - lcdDrawNumber(xnum, y, telemetry_data.radio_compid, 0); - y += FH; - lcdDrawText(x1, y, PSTR("Rad Sys")); - lcdDrawNumber(xnum, y, telemetry_data.radio_sysid, 0); -*/ - - } -} - -/*! \brief Flight mode menu - * \details Clear display of current flight mode. - * \todo Add functionality to change flight mode. - */ -void menuTelemetryMavlinkFlightMode(void) { - - mav_title(STR_MAVLINK_MODE, MAVLINK_menu); - - uint8_t x, y; - x = 0; - y = FH; - - lcdDrawText(x, y, STR_MAVLINK_CUR_MODE); - y += FH; - print_mav_mode(FW, y, telemetry_data.custom_mode, DBLSIZE); - y += 2 * FH; - - char * ptr = mav_statustext; - for (uint8_t j = 0; j < LEN_STATUSTEXT; j++) { - if (*ptr == 0) { - lcdDrawChar(x, y, ' '); - } else { - lcdDrawChar(x, y, *ptr++); - } - x += FW; - } - y += FH; - x = 0; - - if (telemetry_data.active) - lcdDrawText (FW, y, STR_MAVLINK_ARMED, DBLSIZE); -} - -/*! \brief Batterystatus dislplay - * \details Shows flight batery status. - * Also RC and PC RSSI are in this menu. - */ -void menuTelemetryMavlinkBattery(void) { - - mav_title(STR_MAVLINK_BAT_MENU_TITLE, MAVLINK_menu); - - uint8_t x, y, ynum; - x = 7 * FWNUM; -// x = xnum + 0 * FW; - ynum = 2 * FH; - y = 3 * FH; - - lcdDrawText(0, 1*FH, STR_MAVLINK_BATTERY_LABEL); - - lcdDrawNumber(x, ynum, telemetry_data.vbat, (DBLSIZE | PREC1 | UNSIGN)); - lcdDrawText(x, y, PSTR("V")); - x += 4 * (2 * FWNUM); - lcdDrawNumber(x, ynum, telemetry_data.ibat, (DBLSIZE | PREC1 | UNSIGN)); - lcdDrawText(x, y, PSTR("A")); - x += 4 * (2 * FWNUM); - lcdDrawNumber(x, ynum, telemetry_data.rem_bat, (DBLSIZE | UNSIGN)); - lcdDrawText(x, y, PSTR("%")); - y += FH; - ynum += 3 * FH; - - x = 0; - lcdDrawText(x, y, STR_MAVLINK_RC_RSSI_LABEL); - lcdDrawNumber(x + 7 * FWNUM, ynum, telemetry_data.rc_rssi, (DBLSIZE | UNSIGN)); - lcdDrawText(x + 7 * FWNUM, ynum + FH, PSTR("%")); - if (g_model.mavlink.pc_rssi_en) - { - x += 8 * (2 * FWNUM); - lcdDrawText(x, y, STR_MAVLINK_PC_RSSI_LABEL); - lcdDrawNumber(x + 7 * FWNUM, ynum, telemetry_data.pc_rssi, (DBLSIZE)); - lcdDrawText(x + 7 * FWNUM, ynum + FH, PSTR("%")); - } - -} - -/*! \brief Navigation dislplay - * \details Shows Navigation telemetry. - * Altitude in this menu is the relative (to the home location) altitude. This - * is the same altitude used by the waypoints. - * \todo Add a similar menu to fly back to the home location. - */ -void menuTelemetryMavlinkNavigation(void) { - - mav_title(STR_MAVLINK_NAV_MENU_TITLE, MAVLINK_menu); - - uint8_t x, y, ynum; - x = 7 * FWNUM; -// x = xnum + 0 * FW; - ynum = 2 * FH; - y = FH; - - - x = 0; - lcdDrawText(x, y, STR_MAVLINK_COURSE); - lcdDrawNumber(x + 7 * FWNUM, ynum, telemetry_data.course, (DBLSIZE | UNSIGN)); - lcdDrawText(x + 7 * FWNUM, ynum, PSTR("o")); - x += 8 * (2 * FWNUM); - lcdDrawText(x, y, STR_MAVLINK_HEADING); - lcdDrawNumber(x + 7 * FWNUM, ynum, telemetry_data.heading, (DBLSIZE | UNSIGN)); - lcdDrawText(x + 7 * FWNUM, ynum, PSTR("o")); - y += 3 * FH; - ynum += 3 * FH; - - x = 0; - lcdDrawText(x, y, STR_MAVLINK_BEARING); - lcdDrawNumber(x + 7 * FWNUM, ynum, telemetry_data.bearing, (DBLSIZE | UNSIGN)); - lcdDrawText(x + 7 * FWNUM, ynum, PSTR("o")); - x += 8 * (2 * FWNUM); - lcdDrawText(x, y, STR_MAVLINK_ALTITUDE); - lcd_outdezFloat(x + 4 * FWNUM - 1, ynum, telemetry_data.loc_current.rel_alt, 1, (DBLSIZE)); - lcdDrawText(x + 7 * FWNUM, ynum + FH, PSTR("m")); - -} - - - -/*! \brief GPS information menu - * \details Menu gives a lot of info from the gps like fix type, position, - * attitude, heading and velocity. Text is small and the user must focus to - * read it. - * \todo Text is small. Should we do something about this or leaf it like this. - * I don't think will be used much when a user is concentrated on flying. - */ -void menuTelemetryMavlinkGPS(void) { - mav_title(STR_MAVLINK_GPS, MAVLINK_menu); - - uint8_t x1, x2, xnum, xnum2, y; - x1 = FW; - x2 = x1 + 12 * FW; - xnum = 7 * FW + 3 * FWNUM; - xnum2 = xnum + 11 * FWNUM; - y = FH; - - lcdDrawSizedText(x1, y, STR_MAVLINK_GPS, 3, 0); - if (telemetry_data.fix_type < 2) { - lcdDrawSizedText(xnum, y, STR_MAVLINK_NO_FIX, 6, 0); - } else { - lcdDrawNumber(xnum, y, telemetry_data.fix_type, 0, 3); - lcdDrawText(xnum, y, PSTR("D")); - } - lcdDrawText(x2, y, STR_MAVLINK_SAT); - lcdDrawNumber(xnum2, y, telemetry_data.satellites_visible, 0, 2); - -// if (telemetry_data.fix_type > 0) { - y += FH; - lcdDrawText(x1, y, STR_MAVLINK_HDOP); - lcd_outdezFloat(xnum, y, telemetry_data.eph, 2); - - y += FH; - lcdDrawText(x1, y, STR_MAVLINK_LAT); - lcd_outdezFloat(xnum, y, telemetry_data.loc_current.lat, 2); - - lcdDrawSizedText(x2, y, STR_MAVLINK_LON, 3, 0); - lcd_outdezFloat(xnum2, y, telemetry_data.loc_current.lon, 2); - - y += FH; - lcdDrawSizedText(x1, y, STR_MAVLINK_ALTITUDE, 3, 0); - lcdDrawNumber(xnum, y, telemetry_data.loc_current.gps_alt, 0); - - y += FH; - lcdDrawSizedText(x1, y, STR_MAVLINK_COURSE, 6, 0); - lcd_outdezFloat(xnum, y, telemetry_data.course, 2); - - y += FH; - lcdDrawSizedText(x1, y, PSTR("V"), 1, 0); - lcdDrawNumber(xnum, y, telemetry_data.v, 0); - //} -} - -#ifdef DUMP_RX_TX -//! \brief Display one byte as hex. -void lcd_outhex2(uint8_t x, uint8_t y, uint8_t val) { - x += FWNUM * 2; - for (int i = 0; i < 2; i++) { - x -= FWNUM; - char c = val & 0xf; - c = c > 9 ? c + 'A' - 10 : c + '0'; - lcdDrawChar(x, y, c, c >= 'A' ? CONDENSED : 0); - val >>= 4; - } -} - -//! \brief Hex dump of the current mavlink message. -void menuTelemetryMavlinkDump(event_t event) { - uint8_t x = 0; - uint8_t y = FH; - uint16_t count = 0; - uint16_t bufferLen = 0; - uint8_t *ptr = NULL; - switch (MAVLINK_menu) { - case MENU_DUMP_RX: - mav_dump_rx = 1; - mav_title(PSTR("RX"), MAVLINK_menu); - bufferLen = mavlinkRxBufferCount; - ptr = mavlinkRxBuffer; - break; - - case MENU_DUMP_TX: - mav_title(PSTR("TX"), MAVLINK_menu); - bufferLen = serialTxBufferCount; - ptr = ptrTxISR; - break; - default: - break; - } - for (uint16_t var = 0; var < bufferLen; var++) { - uint8_t byte = *ptr++; - lcd_outhex2(x, y, byte); - x += 2 * FW; - count++; - if (count > 8) { - count = 0; - x = 0; - y += FH; - if (y == (6 * FH)) - break; - } - } -} -#endif - - -/*! \brief Mavlink General setup menu. - * \details Setup menu for generic mavlink settings. - * Current menu items - * - RC RSSI scale item. Used to adjust the scale of the RSSI indicator to match - * the actual rssi value - * - PC RSSI enable item. Can be used to dissable PC RSSI display if not used. - * This funcion is called from the model setup menus, not directly by the - * telemetry menus - */ -void menuModelTelemetryMavlink(event_t event) { - - MENU(STR_MAVMENUSETUP_TITLE, menuTabModel, MENU_MODEL_TELEMETRY_MAVLINK, ITEM_MAVLINK_MAX + 1, {0, 0, 1/*to force edit mode*/}); - - uint8_t sub = menuVerticalPosition - 1; - - for (uint8_t i=0; i0) ? BLINK|INVERS : INVERS); - uint8_t attr = (sub == k ? blink : 0); - switch(k) { - case ITEM_MAVLINK_RC_RSSI_SCALE: - lcdDrawTextAlignedLeft(y, STR_MAVLINK_RC_RSSI_SCALE_LABEL); - lcdDrawNumber(VIEW_MAVLINK_2ND_COLUMN, y, (25 + g_model.mavlink.rc_rssi_scale * 5), attr|LEFT); - lcdDrawChar(lcdLastRightPos, y, '%'); - if (attr) CHECK_INCDEC_MODELVAR(event, g_model.mavlink.rc_rssi_scale, 0, 15); - break; - case ITEM_MAVLINK_PC_RSSI_EN: - g_model.mavlink.pc_rssi_en = editCheckBox(g_model.mavlink.pc_rssi_en, - VIEW_MAVLINK_2ND_COLUMN, - y, - STR_MAVLINK_PC_RSSI_EN_LABEL, - attr, - event); - break; - } - } -} diff --git a/radio/src/gui/128x64/view_mavlink.h b/radio/src/gui/128x64/view_mavlink.h deleted file mode 100644 index e551dd1a7..000000000 --- a/radio/src/gui/128x64/view_mavlink.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) OpenTX - * - * Based on code named - * th9x - http://code.google.com/p/th9x - * er9x - http://code.google.com/p/er9x - * gruvin9x - http://code.google.com/p/gruvin9x - * - * License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - */ - -/*! \file view_mavlink.h - * Mavlink menu include file - */ - -#ifndef _VIEW_MAVLINK_H_ -#define _VIEW_MAVLINK_H_ - -#include "opentx.h" -#include "telemetry/mavlink.h" - -#define APSIZE (BSS | DBLSIZE) - -void menuViewTelemetryMavlink(event_t event); -void lcd_outdezFloat(uint8_t x, uint8_t y, float val, uint8_t precis, uint8_t mode = 0); -void mav_title(const pm_char * s, uint8_t index); -void menuTelemetryMavlinkInfos(void); -void menuTelemetryMavlinkFlightMode(void); -void menuTelemetryMavlinkBattery(void); -void menuTelemetryMavlinkNavigation(void); -void menuTelemetryMavlinkGPS(void); -#ifdef DUMP_RX_TX -void lcd_outhex2(uint8_t x, uint8_t y, uint8_t val); -void menuTelemetryMavlinkDump(event_t event); -#endif - -/*! \brief Mavlink menu enumerator - * \details Used to create a readable case statement for the - * \link menuTelemetryMavlink menuTelemetryMavlink \endlink funtion. - */ -enum mavlink_menu_ { - MENU_INFO = 0, // - MENU_MODE, - MENU_BATT, - MENU_NAV, - MENU_GPS, // -#ifdef DUMP_RX_TX - MENU_DUMP_RX, // - MENU_DUMP_TX, // -#endif - MAX_MAVLINK_MENU -}; - -//! \brief Pointer array to mavlink settings menus. -const MenuHandlerFunc menuTabMav[] PROGMEM = { - menuViewTelemetryMavlink -}; - -//! \brief Mavlink setup menu configuration items list. -enum menuMavlinkSetupItems { - ITEM_MAVLINK_RC_RSSI_SCALE, - ITEM_MAVLINK_PC_RSSI_EN, - ITEM_MAVLINK_MAX -}; - -//! \brief Menu index varible, initialized on info menu. -extern uint8_t MAVLINK_menu; - -#endif // _VIEW_MAVLINK_H_ diff --git a/radio/src/gui/212x64/menu_model.cpp b/radio/src/gui/212x64/menu_model.cpp index 7e8bdd228..547c76cd8 100644 --- a/radio/src/gui/212x64/menu_model.cpp +++ b/radio/src/gui/212x64/menu_model.cpp @@ -38,7 +38,6 @@ const MenuHandlerFunc menuTabModel[] = { menuModelCustomScripts, #endif CASE_FRSKY(menuModelTelemetryFrsky) - CASE_MAVLINK(menuModelTelemetryMavlink) menuModelDisplay }; diff --git a/radio/src/gui/212x64/menus.h b/radio/src/gui/212x64/menus.h index 9a1d214b3..91fb3be07 100644 --- a/radio/src/gui/212x64/menus.h +++ b/radio/src/gui/212x64/menus.h @@ -101,7 +101,6 @@ enum MenuModelIndexes { MENU_MODEL_CUSTOM_SCRIPTS, #endif MENU_MODEL_TELEMETRY_FRSKY, - CASE_MAVLINK(MENU_MODEL_TELEMETRY_MAVLINK) MENU_MODEL_DISPLAY, MENU_MODEL_PAGES_COUNT }; diff --git a/radio/src/gui/212x64/radio_setup.cpp b/radio/src/gui/212x64/radio_setup.cpp index 4991e1a54..edc9c1fe7 100644 --- a/radio/src/gui/212x64/radio_setup.cpp +++ b/radio/src/gui/212x64/radio_setup.cpp @@ -86,7 +86,6 @@ enum MenuRadioSetupItems { ITEM_SETUP_LANGUAGE, ITEM_SETUP_IMPERIAL, IF_FAI_CHOICE(ITEM_SETUP_FAI) - CASE_MAVLINK(ITEM_MAVLINK_BAUD) ITEM_SETUP_SWITCHES_DELAY, ITEM_SETUP_USB_MODE, ITEM_SETUP_RX_CHANNEL_ORD, @@ -117,7 +116,7 @@ void menuRadioSetup(event_t event) } #endif - MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, ITEM_SETUP_MAX, { 2, 2, 0, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, 0,IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_PCBX9E_PCBX9DP(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) CASE_MAVLINK(0) 0, 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ }); + MENU(STR_MENURADIOSETUP, menuTabGeneral, MENU_RADIO_SETUP, ITEM_SETUP_MAX, { 2, 2, 0, 1, LABEL(SOUND), 0, 0, 0, 0, 0, 0, 0, CASE_VARIO(LABEL(VARIO)) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_VARIO(0) CASE_HAPTIC(LABEL(HAPTIC)) CASE_HAPTIC(0) CASE_HAPTIC(0) CASE_HAPTIC(0) 0, LABEL(ALARMS), 0, 0, 0, 0, 0,IF_ROTARY_ENCODERS(0) LABEL(BACKLIGHT), 0, 0, 0, CASE_PCBX9E_PCBX9DP(0) 0, CASE_SPLASH_PARAM(0) CASE_GPS(LABEL(GPS)) CASE_GPS(0) CASE_GPS(0) CASE_GPS(0) CASE_PXX(0) 0, 0, IF_FAI_CHOICE(0) 0, 0, 0, LABEL(TX_MODE), 0, 1/*to force edit mode*/ }); if (event == EVT_ENTRY) { reusableBuffer.generalSettings.stickMode = g_eeGeneral.stickMode; diff --git a/radio/src/gui/480x272/menu_model.cpp b/radio/src/gui/480x272/menu_model.cpp index 419a39082..100904fcf 100644 --- a/radio/src/gui/480x272/menu_model.cpp +++ b/radio/src/gui/480x272/menu_model.cpp @@ -37,7 +37,6 @@ const MenuHandlerFunc menuTabModel[] = { menuModelCustomScripts, #endif CASE_FRSKY(menuModelTelemetryFrsky) - CASE_MAVLINK(menuModelTelemetryMavlink) }; void editCurveRef(coord_t x, coord_t y, CurveRef & curve, event_t event, LcdFlags attr); diff --git a/radio/src/gui/480x272/radio_setup.cpp b/radio/src/gui/480x272/radio_setup.cpp index 02bd964fa..b42f100a2 100644 --- a/radio/src/gui/480x272/radio_setup.cpp +++ b/radio/src/gui/480x272/radio_setup.cpp @@ -74,7 +74,6 @@ enum menuRadioSetupItems { ITEM_SETUP_LANGUAGE, ITEM_SETUP_IMPERIAL, IF_FAI_CHOICE(ITEM_SETUP_FAI) - // CASE_MAVLINK(ITEM_MAVLINK_BAUD) ITEM_SETUP_SWITCHES_DELAY, ITEM_SETUP_USB_MODE, ITEM_SETUP_RX_CHANNEL_ORD, diff --git a/radio/src/opentx.h b/radio/src/opentx.h index bb9dc5fc9..dc6f766a5 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -123,8 +123,6 @@ #define CASE_FRSKY(x) #endif - #define CASE_MAVLINK(x) - #if defined(PXX) #define CASE_PXX(x) x, #else diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index 9f252daa0..b9b15e0cf 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -306,19 +306,6 @@ void simuSetSwitch(uint8_t swtch, int8_t state) SWITCH_CASE(4, PIOA->PIO_PDSR, 1<<2) SWITCH_CASE(5, PIOC->PIO_PDSR, 1<<16) SWITCH_CASE(6, PIOC->PIO_PDSR, 1<<8) -#else // PCB9X - SWITCH_3_CASE(0, ping, pine, (1<