/* * Copyright (C) EdgeTX * * Based on code named * opentx - https://github.com/opentx/opentx * 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 "opentx.h" #include "../../hal/adc_driver.h" #define HOLDANAVALUEFRAMES 4 /* 4* 50ms = 200 ms update rate */ void menuRadioDiagAnalogs(event_t event) { static int8_t entryCount = 0; static uint16_t lastShownAnalogValue[NUM_STICKS+NUM_POTS+NUM_SLIDERS]; enum ANAVIEWS{ ANAVIEW_FIRST, ANAVIEW_CALIB=ANAVIEW_FIRST, ANAVIEW_RAWLOWFPS, ANAVIEW_LAST=ANAVIEW_RAWLOWFPS }; static int viewpage = ANAVIEW_FIRST; if (event == EVT_KEY_BREAK(KEY_PAGE)) { if (viewpage == ANAVIEW_LAST) viewpage = ANAVIEW_FIRST; else viewpage++; if (viewpage == ANAVIEW_RAWLOWFPS) entryCount = 0; } switch (viewpage) { case (ANAVIEW_CALIB): SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS_CALIB, 0); break; case (ANAVIEW_RAWLOWFPS): SIMPLE_SUBMENU(STR_MENU_RADIO_ANALOGS_RAWLOWFPS, 0); break; } for (uint8_t i=0; i HOLDANAVALUEFRAMES) entryCount = 0; else entryCount++; } }