/* * 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. */ #include #include "opentx.h" void displayFlightModes(coord_t x, coord_t y, FlightModesType value, uint8_t attr) { for (int i=0; i=0) { drawColumnHeader(STR_PHASES_HEADERS, posHorz); } for (int i=0; i0) ? BLINK|INVERS : INVERS) : 0); LcdFlags active = (attr && s_editMode>0) ; switch (j) { case ITEM_FLIGHT_MODES_NAME: editName(FLIGHT_MODES_NAME_COLUMN, y, p->name, sizeof(p->name), event, attr); break; case ITEM_FLIGHT_MODES_SWITCH: if (active) CHECK_INCDEC_MODELSWITCH(event, p->swtch, SWSRC_FIRST_IN_MIXES, SWSRC_LAST_IN_MIXES, isSwitchAvailableInMixes); if (k == 0) lcdDrawText(FLIGHT_MODES_SWITCH_COLUMN, y, "N/A"); else putsSwitches(FLIGHT_MODES_SWITCH_COLUMN, y, p->swtch, attr); break; case ITEM_FLIGHT_MODES_TRIM_RUD: case ITEM_FLIGHT_MODES_TRIM_ELE: case ITEM_FLIGHT_MODES_TRIM_THR: case ITEM_FLIGHT_MODES_TRIM_AIL: { uint8_t t = j-ITEM_FLIGHT_MODES_TRIM_RUD; if (active) { trim_t & v = p->trim[t]; v.mode = checkIncDec(event, v.mode==TRIM_MODE_NONE ? -1 : v.mode, -1, k==0 ? 0 : 2*MAX_FLIGHT_MODES-1, EE_MODEL, isTrimModeAvailable); } putsTrimMode(FLIGHT_MODES_TRIMS_COLUMN+j*FLIGHT_MODES_TRIM_WIDTH, y, k, t, attr); break; } case ITEM_FLIGHT_MODES_FADE_IN: if (active) p->fadeIn = checkIncDec(event, p->fadeIn, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS); lcdDrawNumber(FLIGHT_MODES_FADEIN_COLUMN, y, (10/DELAY_STEP)*p->fadeIn, attr|PREC1|RIGHT); break; case ITEM_FLIGHT_MODES_FADE_OUT: if (active) p->fadeOut = checkIncDec(event, p->fadeOut, 0, DELAY_MAX, EE_MODEL|NO_INCDEC_MARKS); lcdDrawNumber(FLIGHT_MODES_FADEOUT_COLUMN, y, (10/DELAY_STEP)*p->fadeOut, attr|PREC1|RIGHT); break; } } } return true; }