mirror of
https://github.com/opentx/opentx.git
synced 2025-07-26 01:35:21 +03:00
New telemetry screens (bars)
New telemetry units for A1 / A2 Update to pgmtypes according to Michal patch (suggested by gcc developers!) EEPROM v204
This commit is contained in:
parent
2c64004e7c
commit
caa2aec727
22 changed files with 670 additions and 558 deletions
|
@ -90,7 +90,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
uint8_t subN = 1;
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_BEEPER);
|
||||
lcd_putsLeft( y, STR_BEEPER);
|
||||
lcd_putsnAtt(PARAM_OFS - 2*FW, y, STR_VBEEPER+LEN_VBEEPER*g_eeGeneral.beeperVal, LEN_VBEEPER, (sub==subN ? INVERS:0));
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.beeperVal, 0, 6);
|
||||
if((y+=FH)>7*FH) return;
|
||||
|
@ -98,7 +98,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
#ifdef AUDIO
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_SPKRPITCH);
|
||||
lcd_putsLeft( y, STR_SPKRPITCH);
|
||||
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.speakerPitch,(sub==subN ? INVERS : 0)|LEFT);
|
||||
if (sub==subN) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.speakerPitch, 0, 100);
|
||||
|
@ -109,7 +109,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
#ifdef HAPTIC
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_HAPTICSTRENGTH);
|
||||
lcd_putsLeft( y, STR_HAPTICSTRENGTH);
|
||||
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.hapticStrength, (sub==subN ? INVERS : 0)|LEFT);
|
||||
if (sub==subN) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.hapticStrength, 0, 5);
|
||||
|
@ -119,7 +119,7 @@ void menuProcSetup(uint8_t event)
|
|||
#endif
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_CONTRAST);
|
||||
lcd_putsLeft( y, STR_CONTRAST);
|
||||
lcd_outdezAtt(PARAM_OFS,y,g_eeGeneral.contrast,(sub==subN ? INVERS : 0)|LEFT);
|
||||
if(sub==subN) {
|
||||
CHECK_INCDEC_GENVAR(event, g_eeGeneral.contrast, 10, 45);
|
||||
|
@ -129,14 +129,14 @@ void menuProcSetup(uint8_t event)
|
|||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y,STR_BATTERYWARNING);
|
||||
lcd_putsLeft( y,STR_BATTERYWARNING);
|
||||
putsVolts(PARAM_OFS, y, g_eeGeneral.vBatWarn, (sub==subN ? INVERS : 0)|LEFT);
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.vBatWarn, 40, 120); //4-12V
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y,STR_INACTIVITYALARM);
|
||||
lcd_putsLeft( y,STR_INACTIVITYALARM);
|
||||
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.inactivityTimer, (sub==subN ? INVERS : 0)|LEFT);
|
||||
lcd_putc(lcd_lastPos, y, 'm');
|
||||
if(sub==subN) g_eeGeneral.inactivityTimer = checkIncDec(event, g_eeGeneral.inactivityTimer, 0, 250, EE_GENERAL); //0..250minutes
|
||||
|
@ -144,49 +144,49 @@ void menuProcSetup(uint8_t event)
|
|||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y,STR_FILTERADC);
|
||||
lcd_putsLeft( y,STR_FILTERADC);
|
||||
lcd_putsnAtt(PARAM_OFS, y, STR_ADCFILTER+LEN_ADCFILTER*g_eeGeneral.filterInput, LEN_ADCFILTER, (sub==subN ? INVERS:0));
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.filterInput, 0, 2);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y,STR_THROTTLEREVERSE);
|
||||
lcd_putsLeft( y,STR_THROTTLEREVERSE);
|
||||
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.throttleReversed, sub==subN ) ;
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.throttleReversed, 0, 1);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_MINUTEBEEP);
|
||||
lcd_putsLeft( y, STR_MINUTEBEEP);
|
||||
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.minuteBeep, sub==subN ) ;
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.minuteBeep, 0, 1);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_BEEPCOUNTDOWN);
|
||||
lcd_putsLeft( y, STR_BEEPCOUNTDOWN);
|
||||
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.preBeep, sub==subN ) ;
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.preBeep, 0, 1);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_FLASHONBEEP);
|
||||
lcd_putsLeft( y, STR_FLASHONBEEP);
|
||||
menu_lcd_onoff( PARAM_OFS, y, g_eeGeneral.flashBeep, sub==subN ) ;
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.flashBeep, 0, 1);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_LIGHTSWITCH);
|
||||
lcd_putsLeft( y, STR_LIGHTSWITCH);
|
||||
putsSwitches(PARAM_OFS,y,g_eeGeneral.lightSw,sub==subN ? INVERS : 0);
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.lightSw, -MAX_SWITCH, MAX_SWITCH);
|
||||
if((y+=FH)>7*FH) return;
|
||||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_LIGHTOFFAFTER);
|
||||
lcd_putsLeft( y, STR_LIGHTOFFAFTER);
|
||||
if(g_eeGeneral.lightAutoOff) {
|
||||
lcd_outdezAtt(PARAM_OFS, y, g_eeGeneral.lightAutoOff*5,LEFT|(sub==subN ? INVERS : 0));
|
||||
lcd_putc(lcd_lastPos, y, 's');
|
||||
|
@ -201,7 +201,7 @@ void menuProcSetup(uint8_t event)
|
|||
#ifdef SPLASH
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t b = 1-g_eeGeneral.disableSplashScreen;
|
||||
lcd_puts_P(0, y,STR_SPLASHSCREEN);
|
||||
lcd_putsLeft( y,STR_SPLASHSCREEN);
|
||||
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
|
||||
if(sub==subN)
|
||||
{
|
||||
|
@ -214,7 +214,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t b = 1-g_eeGeneral.disableThrottleWarning;
|
||||
lcd_puts_P(0, y,STR_THROTTLEWARNING);
|
||||
lcd_putsLeft( y,STR_THROTTLEWARNING);
|
||||
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
|
||||
if(sub==subN)
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ void menuProcSetup(uint8_t event)
|
|||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P(0, y, STR_SWITCHWARNING);
|
||||
lcd_putsLeft( y, STR_SWITCHWARNING);
|
||||
lcd_putsnAtt(PARAM_OFS, y, STR_WARNSW+LEN_WARNSW*(1+g_eeGeneral.switchWarning), LEN_WARNSW, (sub==subN ? INVERS:0));
|
||||
if(sub==subN) CHECK_INCDEC_GENVAR(event, g_eeGeneral.switchWarning, -1, 1);
|
||||
if((y+=FH)>7*FH) return;
|
||||
|
@ -233,7 +233,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t b = 1-g_eeGeneral.disableMemoryWarning;
|
||||
lcd_puts_P(0, y, STR_MEMORYWARNING);
|
||||
lcd_putsLeft( y, STR_MEMORYWARNING);
|
||||
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
|
||||
if(sub==subN)
|
||||
{
|
||||
|
@ -245,7 +245,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t b = 1-g_eeGeneral.disableAlarmWarning;
|
||||
lcd_puts_P(0, y,STR_ALARMWARNING);
|
||||
lcd_putsLeft( y,STR_ALARMWARNING);
|
||||
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
|
||||
if(sub==subN)
|
||||
{
|
||||
|
@ -257,7 +257,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t b = g_eeGeneral.enableTelemetryAlarm;
|
||||
lcd_puts_P(0, y,STR_NODATAALARM);
|
||||
lcd_putsLeft( y,STR_NODATAALARM);
|
||||
menu_lcd_onoff( PARAM_OFS, y, b, sub==subN ) ;
|
||||
if(sub==subN)
|
||||
{
|
||||
|
@ -269,7 +269,7 @@ void menuProcSetup(uint8_t event)
|
|||
|
||||
if(s_pgOfs<subN) {
|
||||
uint8_t attr = sub==subN?INVERS:0;
|
||||
lcd_puts_P(0, y,STR_RXCHANNELORD);// RAET->AETR
|
||||
lcd_putsLeft( y,STR_RXCHANNELORD);// RAET->AETR
|
||||
for (uint8_t i=1; i<=4; i++)
|
||||
putsChnLetter((16+i)*FW, y, channel_order(i), attr);
|
||||
if(attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.templateSetup, 0, 23);
|
||||
|
@ -277,7 +277,7 @@ void menuProcSetup(uint8_t event)
|
|||
}subN++;
|
||||
|
||||
if(s_pgOfs<subN) {
|
||||
lcd_puts_P( 1*FW, y, STR_MODE2); // TODO STR_MODE would save flash
|
||||
lcd_puts( 1*FW, y, STR_MODE2); // TODO STR_MODE would save flash
|
||||
if(y<7*FH) {for(uint8_t i=0; i<4; i++) lcd_img((6+4*i)*FW, y, sticks,i,0); }
|
||||
if((y+=FH)>7*FH) return;
|
||||
|
||||
|
@ -397,11 +397,11 @@ void menuProcTrainer(uint8_t event)
|
|||
uint8_t blink ;
|
||||
|
||||
if (SLAVE_MODE) { // i am the slave
|
||||
lcd_puts_P(7*FW, 3*FH, STR_SLAVE);
|
||||
lcd_puts(7*FW, 3*FH, STR_SLAVE);
|
||||
return;
|
||||
}
|
||||
|
||||
lcd_puts_P(3*FW, 1*FH, STR_MODESRC);
|
||||
lcd_puts(3*FW, 1*FH, STR_MODESRC);
|
||||
|
||||
sub--;
|
||||
y = 2*FH;
|
||||
|
@ -434,7 +434,7 @@ void menuProcTrainer(uint8_t event)
|
|||
y += FH;
|
||||
}
|
||||
|
||||
lcd_puts_P(0*FW, y, STR_MULTIPLIER);
|
||||
lcd_puts(0*FW, y, STR_MULTIPLIER);
|
||||
lcd_outdezAtt(13*FW, y, g_eeGeneral.PPM_Multiplier+10, (sub==4 ? INVERS : 0)|PREC1);
|
||||
if(sub==4) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40);
|
||||
y += FH;
|
||||
|
@ -463,11 +463,11 @@ void menuProcDiagVers(uint8_t event)
|
|||
{
|
||||
SIMPLE_MENU(STR_MENUVERSION, menuTabDiag, e_Vers, 1);
|
||||
|
||||
lcd_puts_P(0, 2*FH,stamp1 );
|
||||
lcd_puts_P(0, 3*FH,stamp2 );
|
||||
lcd_puts_P(0, 4*FH,stamp3 );
|
||||
lcd_puts_P(0, 5*FH,stamp4 );
|
||||
lcd_puts_P(0, 7*FH,STR_EEPROMV);
|
||||
lcd_putsLeft( 2*FH,stamp1 );
|
||||
lcd_putsLeft( 3*FH,stamp2 );
|
||||
lcd_putsLeft( 4*FH,stamp3 );
|
||||
lcd_putsLeft( 5*FH,stamp4 );
|
||||
lcd_putsLeft( 7*FH,STR_EEPROMV);
|
||||
lcd_outdezAtt(8*FW, 7*FH, g_eeGeneral.myVers, LEFT);
|
||||
}
|
||||
|
||||
|
@ -500,7 +500,7 @@ void menuProcDiagKeys(uint8_t event)
|
|||
}
|
||||
#endif
|
||||
|
||||
lcd_puts_P(14*FW, 3*FH, STR_VTRIM);
|
||||
lcd_puts(14*FW, 3*FH, STR_VTRIM);
|
||||
for(uint8_t i=0; i<4; i++)
|
||||
{
|
||||
uint8_t y=i*FH+FH*4;
|
||||
|
@ -531,7 +531,7 @@ void menuProcDiagAna(uint8_t event)
|
|||
// lcd_outdezAtt( 21*FW, 3*FH, g_eeGeneral.vBatCalib, 0) ;
|
||||
// lcd_outdezAtt( 21*FW, 4*FH, abRunningAvg, 0) ;
|
||||
// Display raw BandGap result (debug)
|
||||
lcd_puts_P( 19*FW, 5*FH, STR_BG) ;
|
||||
lcd_puts( 19*FW, 5*FH, STR_BG) ;
|
||||
lcd_outdezAtt(21*FW, 6*FH, BandGap, 0);
|
||||
lcd_outdezAtt(21*FW, 7*FH, anaIn(7)*35/512, PREC1);
|
||||
|
||||
|
@ -576,15 +576,13 @@ void menuProcDiagCalib(uint8_t event)
|
|||
switch (idxState) {
|
||||
case 0:
|
||||
// START CALIBRATION
|
||||
// [MENU]
|
||||
lcd_puts_P(2*FW, 3*FH, STR_MENUTOSTART);
|
||||
lcd_puts(3*FW, 3*FH, STR_MENUTOSTART);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
// SET MIDPOINT
|
||||
// [MENU]
|
||||
lcd_putsAtt(2*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0);
|
||||
lcd_puts_P(2*FW, 3*FH, STR_MENUWHENDONE);
|
||||
lcd_putsAtt(5*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0);
|
||||
lcd_puts(3*FW, 3*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<7; i++) {
|
||||
loVals[i] = 15000;
|
||||
|
@ -595,9 +593,8 @@ void menuProcDiagCalib(uint8_t event)
|
|||
|
||||
case 2:
|
||||
// MOVE STICKS/POTS
|
||||
// [MENU]
|
||||
lcd_putsAtt(2*FW, 2*FH, STR_MOVESTICKSPOTS, s_noScroll ? INVERS : 0);
|
||||
lcd_puts_P(2*FW, 3*FH, STR_MENUWHENDONE);
|
||||
lcd_putsAtt(3*FW, 2*FH, STR_MOVESTICKSPOTS, s_noScroll ? INVERS : 0);
|
||||
lcd_puts(3*FW, 3*FH, STR_MENUWHENDONE);
|
||||
|
||||
for (uint8_t i=0; i<7; i++) {
|
||||
if (abs(loVals[i]-hiVals[i])>50) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue