mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Backup before extended trims function merge
This commit is contained in:
parent
4788ea632e
commit
f0fca34b7e
53 changed files with 18727 additions and 0 deletions
105
src/statistics_views.cpp
Normal file
105
src/statistics_views.cpp
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Authors (alphabetical order)
|
||||
* - Bertrand Songis <bsongis@gmail.com>
|
||||
* - Bryan J. Rentoul (Gruvin) <gruvin@gmail.com>
|
||||
*
|
||||
* gruvin9x is based on code named er9x by
|
||||
* Author - Erez Raviv <erezraviv@gmail.com>, which is in turn
|
||||
* was based on the original (and ongoing) project by Thomas Husterer,
|
||||
* th9x -- http://code.google.com/p/th9x/
|
||||
*
|
||||
* 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 "menus.h"
|
||||
|
||||
void menuProcStatistic(uint8_t event)
|
||||
{
|
||||
TITLE("STAT");
|
||||
switch(event)
|
||||
{
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
chainMenu(menuProcStatistic2);
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
}
|
||||
|
||||
lcd_puts_P( 1*FW, FH*1, PSTR("TME"));
|
||||
putsTime( 5*FW, FH*1, s_timeCumAbs, 0, 0);
|
||||
lcd_puts_P( 17*FW, FH*1, PSTR("TSW"));
|
||||
putsTime( 11*FW, FH*1, s_timeCumSw, 0, 0);
|
||||
|
||||
lcd_puts_P( 1*FW, FH*2, PSTR("STK"));
|
||||
putsTime( 5*FW, FH*2, s_timeCumThr, 0, 0);
|
||||
lcd_puts_P( 17*FW, FH*2, PSTR("ST%"));
|
||||
putsTime( 11*FW, FH*2, s_timeCum16ThrP/16, 0, 0);
|
||||
|
||||
lcd_puts_P( 17*FW, FH*0, PSTR("TOT"));
|
||||
putsTime( 11*FW, FH*0, s_timeCumTot, 0, 0);
|
||||
|
||||
uint16_t traceRd = s_traceCnt>MAXTRACE ? s_traceWr : 0;
|
||||
uint8_t x=5;
|
||||
uint8_t y=60;
|
||||
lcd_hline(x-3,y,120+3+3);
|
||||
lcd_vline(x,y-32,32+3);
|
||||
|
||||
for(uint8_t i=0; i<120; i+=6)
|
||||
{
|
||||
lcd_vline(x+i+6,y-1,3);
|
||||
}
|
||||
for(uint8_t i=1; i<=120; i++)
|
||||
{
|
||||
lcd_vline(x+i,y-s_traceBuf[traceRd],s_traceBuf[traceRd]);
|
||||
traceRd++;
|
||||
if(traceRd>=MAXTRACE) traceRd=0;
|
||||
if(traceRd==s_traceWr) break;
|
||||
}
|
||||
}
|
||||
|
||||
void menuProcStatistic2(uint8_t event)
|
||||
{
|
||||
TITLE("STAT2");
|
||||
switch(event)
|
||||
{
|
||||
case EVT_KEY_FIRST(KEY_MENU):
|
||||
g_tmr1Latency_min = 0x7ff;
|
||||
g_tmr1Latency_max = 0;
|
||||
g_timeMain = 0;
|
||||
// g_time_per10 = 0;
|
||||
beepKey();
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_DOWN):
|
||||
chainMenu(menuProcStatistic);
|
||||
break;
|
||||
case EVT_KEY_FIRST(KEY_UP):
|
||||
case EVT_KEY_FIRST(KEY_EXIT):
|
||||
chainMenu(menuMainView);
|
||||
break;
|
||||
}
|
||||
lcd_puts_P( 0*FW, 1*FH, PSTR("tmr1Lat max us"));
|
||||
lcd_outdez8(15*FW , 1*FH, g_tmr1Latency_max/2 );
|
||||
lcd_puts_P( 0*FW, 2*FH, PSTR("tmr1Lat min us"));
|
||||
lcd_outdez8(15*FW , 2*FH, g_tmr1Latency_min/2 );
|
||||
lcd_puts_P( 0*FW, 3*FH, PSTR("tmr1 Jitter us"));
|
||||
lcd_outdez8(15*FW , 3*FH, (g_tmr1Latency_max - g_tmr1Latency_min) /2 );
|
||||
lcd_puts_P( 0*FW, 4*FH, PSTR("tmain max ms"));
|
||||
lcd_outdezAtt(15*FW, 4*FH, (g_timeMain*100)/16, PREC2);
|
||||
lcd_puts_P( 0*FW, 5*FH, PSTR("t10ms us"));
|
||||
lcd_outdez8(15*FW , 5*FH, g_time_per10/2 );
|
||||
#ifndef SIMU
|
||||
lcd_puts_P( 0*FW, 6*FH, PSTR("Free Stack min b"));
|
||||
lcd_outdezAtt(18*FW-1, 6*FH, stack_free() ) ;
|
||||
#endif
|
||||
lcd_puts_P( 3*FW, 7*FH, PSTR("[MENU] to reset"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue