[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)
|
#define DISPLAY_PROGRESS_BAR(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint16_t evalChkSum();
|
|
||||||
|
|
||||||
#define eeDeleteModel(x) EFile::rm(FILE_MODEL(x))
|
#define eeDeleteModel(x) EFile::rm(FILE_MODEL(x))
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
|
|||||||
+33
-14
@@ -1049,12 +1049,9 @@ void menuGeneralHardware(uint8_t event)
|
|||||||
}
|
}
|
||||||
#endif
|
#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
|
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);
|
int16_t vt = anaIn(i);
|
||||||
reusableBuffer.calib.loVals[i] = min(vt, reusableBuffer.calib.loVals[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)
|
switch(event)
|
||||||
{
|
{
|
||||||
case EVT_ENTRY:
|
case EVT_ENTRY:
|
||||||
idxState = 0;
|
reusableBuffer.calib.state = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case EVT_KEY_BREAK(KEY_ENTER):
|
case EVT_KEY_BREAK(KEY_ENTER):
|
||||||
idxState++;
|
reusableBuffer.calib.state++;
|
||||||
if (idxState==3) {
|
|
||||||
STORE_GENERALVARS;
|
|
||||||
idxState = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (reusableBuffer.calib.state) {
|
||||||
switch (idxState) {
|
|
||||||
case 0:
|
case 0:
|
||||||
// START CALIBRATION
|
// START CALIBRATION
|
||||||
lcd_putsLeft(3*FH, STR_MENUTOSTART);
|
lcd_putsLeft(3*FH, STR_MENUTOSTART);
|
||||||
@@ -1114,8 +1106,16 @@ void menuGeneralCalib(uint8_t event)
|
|||||||
g_eeGeneral.calibSpanPos[i] = v - v/STICK_TOLERANCE;
|
g_eeGeneral.calibSpanPos[i] = v - v/STICK_TOLERANCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
g_eeGeneral.chkSum = evalChkSum();
|
g_eeGeneral.chkSum = evalChkSum();
|
||||||
|
STORE_GENERALVARS;
|
||||||
|
reusableBuffer.calib.state = 4;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
reusableBuffer.calib.state = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1124,3 +1124,22 @@ void menuGeneralCalib(uint8_t event)
|
|||||||
drawPotsBars();
|
drawPotsBars();
|
||||||
#endif
|
#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 drawPotsBars();
|
||||||
void doMainScreenGraphics();
|
void doMainScreenGraphics();
|
||||||
|
void menuFirstCalib(uint8_t event);
|
||||||
|
|
||||||
void onMainViewMenu(const char *result);
|
void onMainViewMenu(const char *result);
|
||||||
void menuMainView(uint8_t event);
|
void menuMainView(uint8_t event);
|
||||||
void menuGeneralDiagAna(uint8_t event);
|
void menuGeneralDiagAna(uint8_t event);
|
||||||
|
|||||||
+7
-2
@@ -372,6 +372,11 @@ void generalDefault()
|
|||||||
g_eeGeneral.vBatWarn = 90;
|
g_eeGeneral.vBatWarn = 90;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CPUM64)
|
||||||
|
g_eeGeneral.backlightMode = e_backlight_mode_both;
|
||||||
|
g_eeGeneral.lightAutoOff = 2;
|
||||||
|
#endif
|
||||||
|
|
||||||
g_eeGeneral.chkSum = 0xFFFF;
|
g_eeGeneral.chkSum = 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2455,7 +2460,7 @@ void evalFunctions()
|
|||||||
|
|
||||||
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
|
#define MOMENTARY_START_TEST() ( (momentary && !(activeSwitches & switch_mask) && active) || \
|
||||||
(short_long==1 && !active && mSwitchDuration[mswitch]>0 && mSwitchDuration[mswitch]<CFN_PRESSLONG_DURATION) || \
|
(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 short_long = 0;
|
||||||
uint8_t mswitch = 0;
|
uint8_t mswitch = 0;
|
||||||
@@ -3995,7 +4000,7 @@ void opentxStart()
|
|||||||
checkAll();
|
checkAll();
|
||||||
|
|
||||||
if (g_eeGeneral.chkSum != evalChkSum()) {
|
if (g_eeGeneral.chkSum != evalChkSum()) {
|
||||||
pushMenu(menuGeneralCalib);
|
chainMenu(menuFirstCalib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1303,6 +1303,7 @@ union ReusableBuffer
|
|||||||
int16_t midVals[NUM_STICKS+NUM_POTS];
|
int16_t midVals[NUM_STICKS+NUM_POTS];
|
||||||
int16_t loVals[NUM_STICKS+NUM_POTS];
|
int16_t loVals[NUM_STICKS+NUM_POTS];
|
||||||
int16_t hiVals[NUM_STICKS+NUM_POTS];
|
int16_t hiVals[NUM_STICKS+NUM_POTS];
|
||||||
|
uint8_t state;
|
||||||
} calib;
|
} calib;
|
||||||
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
|
|||||||
Reference in New Issue
Block a user