[Horus] Analogs view for debug in the Statistics menu

This commit is contained in:
Bertrand Songis
2016-03-19 19:06:15 +01:00
parent 63d306070a
commit 5925e8eae4
4 changed files with 31 additions and 1 deletions
+5
View File
@@ -96,10 +96,15 @@ const uint8_t LBM_STATS_DEBUG_ICON[] = {
#include "mask_stats_debug.lbm"
};
const uint8_t LBM_STATS_ANALOGS_ICON[] = {
#include "mask_analogs.lbm"
};
const uint8_t * const LBM_STATS_ICONS[] = {
LBM_STATS_ICON,
LBM_STATS_GRAPH_ICON,
LBM_STATS_TIME_ICON,
LBM_STATS_ANALOGS_ICON,
#if defined(DEBUG_TRACE_BUFFER)
LBM_STATS_DEBUG_ICON
#endif
+1 -1
View File
@@ -18,7 +18,7 @@
* GNU General Public License for more details.
*/
#include "../../opentx.h"
#include "opentx.h"
MenuHandlerFunc menuHandlers[5];
evt_t menuEvent = 0;
+3
View File
@@ -148,6 +148,7 @@ enum EnumTabDiag
{
e_StatsGraph,
e_StatsDebug,
e_StatsAnalogs,
#if defined(DEBUG_TRACE_BUFFER)
e_StatsTraces,
#endif
@@ -155,11 +156,13 @@ enum EnumTabDiag
bool menuStatsGraph(evt_t event);
bool menuStatsDebug(evt_t event);
bool menuStatsAnalogs(evt_t event);
bool menuStatsTraces(evt_t event);
static const MenuHandlerFunc menuTabStats[] PROGMEM = {
menuStatsGraph,
menuStatsDebug,
menuStatsAnalogs,
#if defined(DEBUG_TRACE_BUFFER)
menuStatsTraces,
#endif
+22
View File
@@ -140,6 +140,28 @@ bool menuStatsDebug(evt_t event)
return true;
}
bool menuStatsAnalogs(evt_t event)
{
MENU("Analogs", LBM_STATS_ICONS, menuTabStats, e_StatsAnalogs, 0, { 0 });
for (int i=0; i<NUM_STICKS+NUM_POTS; i++) {
coord_t y = MENU_CONTENT_TOP + (i/2)*FH;
coord_t x = MENUS_MARGIN_LEFT + (i & 1 ? LCD_W/2 : 0);
lcdDrawNumber(x, y, i+1, LEADING0|LEFT, 2, NULL, ":");
lcdDrawHexNumber(x+40, y, anaIn(i));
#if defined(JITTER_MEASURE)
lcdDrawNumber(x+100, y, rawJitter[i].get());
lcdDrawNumber(x+140, y, avgJitter[i].get());
lcdDrawNumber(x+180, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
#else
lcdDrawNumber(x+100, y, (int16_t)calibratedStick[CONVERT_MODE(i)]*25/256);
#endif
}
return true;
}
#if defined(DEBUG_TRACE_BUFFER)
#define STATS_TRACES_INDEX_POS MENUS_MARGIN_LEFT
#define STATS_TRACES_TIME_POS MENUS_MARGIN_LEFT + 4*10