/* * 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 "tasks.h" #include "mixer_scheduler.h" #include "hal/adc_driver.h" #if defined(BLUETOOTH) #include "bluetooth_driver.h" #endif #define STATS_1ST_COLUMN 1 #define STATS_2ND_COLUMN 7*FW+FW/2 #define STATS_3RD_COLUMN 14*FW+FW/2 #define STATS_LABEL_WIDTH 3*FW void menuStatisticsView(event_t event) { title(STR_MENUSTAT); switch (event) { case EVT_KEY_FIRST(KEY_UP): case EVT_KEY_BREAK(KEY_PAGEDN): chainMenu(menuStatisticsDebug); break; case EVT_KEY_FIRST(KEY_DOWN): case EVT_KEY_BREAK(KEY_PAGEUP): chainMenu(menuStatisticsDebug2); break; case EVT_KEY_LONG(KEY_ENTER): g_eeGeneral.globalTimer = 0; storageDirty(EE_GENERAL); sessionTimer = 0; break; case EVT_KEY_BREAK(KEY_EXIT): chainMenu(menuMainView); break; } // Session and Total timers lcdDrawText(STATS_1ST_COLUMN, FH*1+1, "SES", BOLD); drawTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*1+1, sessionTimer); lcdDrawText(STATS_1ST_COLUMN, FH*2+1, "TOT", BOLD); drawTimer(STATS_1ST_COLUMN + STATS_LABEL_WIDTH, FH*2+1, g_eeGeneral.globalTimer + sessionTimer, TIMEHOUR, 0); // Throttle special timers lcdDrawText(STATS_2ND_COLUMN, FH*0+1, "THR", BOLD); drawTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*0+1, s_timeCumThr); lcdDrawText(STATS_2ND_COLUMN, FH*1+1, "TH%", BOLD); drawTimer(STATS_2ND_COLUMN + STATS_LABEL_WIDTH, FH*1+1, s_timeCum16ThrP/16); // Timers for (int i=0; i 3600) drawTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val, TIMEHOUR, 0); else drawTimer(STATS_3RD_COLUMN + STATS_LABEL_WIDTH, FH*i+1, timersStates[i].val); } #if defined(THRTRACE) const coord_t x = 5; const coord_t y = 60; lcdDrawSolidHorizontalLine(x-3, y, MAXTRACE+3+3); lcdDrawSolidVerticalLine(x, y-32, 32+3); for (coord_t i=0; i MAXTRACE ? s_traceWr - MAXTRACE : 0; for (coord_t i=1; i<=MAXTRACE && traceRd