[all] First calibration screen reworked
[all] Default settings for backlight
This commit is contained in:
@@ -228,8 +228,6 @@ inline void eeFlush() { theFile.flush(); }
|
||||
#define DISPLAY_PROGRESS_BAR(x)
|
||||
#endif
|
||||
|
||||
uint16_t evalChkSum();
|
||||
|
||||
#define eeDeleteModel(x) EFile::rm(FILE_MODEL(x))
|
||||
|
||||
#if defined(CPUARM)
|
||||
|
||||
+33
-14
@@ -1049,12 +1049,9 @@ void menuGeneralHardware(uint8_t event)
|
||||
}
|
||||
#endif
|
||||
|
||||
void menuGeneralCalib(uint8_t event)
|
||||
|
||||
void menuCommonCalib(uint8_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUCALIBRATION, menuTabDiag, e_Calib, 1);
|
||||
|
||||
static uint8_t idxState;
|
||||
|
||||
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) { //get low and high vals for sticks and trims
|
||||
int16_t vt = anaIn(i);
|
||||
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[i]);
|
||||
@@ -1064,25 +1061,20 @@ void menuGeneralCalib(uint8_t event)
|
||||
}
|
||||
}
|
||||
|
||||
s_noScroll = idxState; // make sure we don't scroll while calibrating
|
||||
s_noScroll = reusableBuffer.calib.state; // make sure we don't scroll while calibrating
|
||||
|
||||
switch(event)
|
||||
{
|
||||
case EVT_ENTRY:
|
||||
idxState = 0;
|
||||
reusableBuffer.calib.state = 0;
|
||||
break;
|
||||
|
||||
case EVT_KEY_BREAK(KEY_ENTER):
|
||||
idxState++;
|
||||
if (idxState==3) {
|
||||
STORE_GENERALVARS;
|
||||
idxState = 0;
|
||||
}
|
||||
reusableBuffer.calib.state++;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (idxState) {
|
||||
switch (reusableBuffer.calib.state) {
|
||||
case 0:
|
||||
// START CALIBRATION
|
||||
lcd_putsLeft(3*FH, STR_MENUTOSTART);
|
||||
@@ -1114,8 +1106,16 @@ void menuGeneralCalib(uint8_t event)
|
||||
g_eeGeneral.calibSpanPos[i] = v - v/STICK_TOLERANCE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 3:
|
||||
g_eeGeneral.chkSum = evalChkSum();
|
||||
STORE_GENERALVARS;
|
||||
reusableBuffer.calib.state = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
reusableBuffer.calib.state = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1124,3 +1124,22 @@ void menuGeneralCalib(uint8_t event)
|
||||
drawPotsBars();
|
||||
#endif
|
||||
}
|
||||
|
||||
void menuGeneralCalib(uint8_t event)
|
||||
{
|
||||
SIMPLE_MENU(STR_MENUCALIBRATION, menuTabDiag, e_Calib, 1);
|
||||
|
||||
menuCommonCalib(event);
|
||||
}
|
||||
|
||||
void menuFirstCalib(uint8_t event)
|
||||
{
|
||||
if (event == EVT_KEY_BREAK(KEY_EXIT) || reusableBuffer.calib.state == 4) {
|
||||
chainMenu(menuMainView);
|
||||
}
|
||||
else {
|
||||
lcd_putsCenter(0*FH, MENUCALIBRATION);
|
||||
lcd_invert_line(0);
|
||||
menuCommonCalib(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,8 @@ inline MenuFuncP lastPopMenu()
|
||||
|
||||
void drawPotsBars();
|
||||
void doMainScreenGraphics();
|
||||
void menuFirstCalib(uint8_t event);
|
||||
|
||||
void onMainViewMenu(const char *result);
|
||||
void menuMainView(uint8_t event);
|
||||
void menuGeneralDiagAna(uint8_t event);
|
||||
|
||||
+7
-2
@@ -372,6 +372,11 @@ void generalDefault()
|
||||
g_eeGeneral.vBatWarn = 90;
|
||||
#endif
|
||||
|
||||
#if !defined(CPUM64)
|
||||
g_eeGeneral.backlightMode = e_backlight_mode_both;
|
||||
g_eeGeneral.lightAutoOff = 2;
|
||||
#endif
|
||||
|
||||
g_eeGeneral.chkSum = 0xFFFF;
|
||||
}
|
||||
|
||||
@@ -2455,7 +2460,7 @@ void evalFunctions()
|
||||
|
||||
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
|
||||
(short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch]<CFN_PRESSLONG_DURATION) || \
|
||||
(short_long==2 && active && mSwitchDuration[mswitch]>=CFN_PRESSLONG_DURATION) )
|
||||
(short_long==2 && active && mSwitchDuration[mswitch]==CFN_PRESSLONG_DURATION) )
|
||||
|
||||
uint8_t short_long = 0;
|
||||
uint8_t mswitch = 0;
|
||||
@@ -3995,7 +4000,7 @@ void opentxStart()
|
||||
checkAll();
|
||||
|
||||
if (g_eeGeneral.chkSum != evalChkSum()) {
|
||||
pushMenu(menuGeneralCalib);
|
||||
chainMenu(menuFirstCalib);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1303,6 +1303,7 @@ union ReusableBuffer
|
||||
int16_t midVals[NUM_STICKS+NUM_POTS];
|
||||
int16_t loVals[NUM_STICKS+NUM_POTS];
|
||||
int16_t hiVals[NUM_STICKS+NUM_POTS];
|
||||
uint8_t state;
|
||||
} calib;
|
||||
|
||||
#if defined(SDCARD)
|
||||
|
||||
Reference in New Issue
Block a user