1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 00:35:18 +03:00

No Center Beeps during calibration

This commit is contained in:
bsongis 2014-06-02 15:20:22 +02:00
parent 9b31bfd3ec
commit fbb90ff5d5
5 changed files with 14 additions and 14 deletions

View file

@ -1501,9 +1501,9 @@ void menuCommonCalib(uint8_t event)
} }
} }
s_noScroll = reusableBuffer.calib.state; // make sure we don't scroll while calibrating calibrationState = reusableBuffer.calib.state; // make sure we don't scroll while calibrating
switch(event) switch (event)
{ {
case EVT_ENTRY: case EVT_ENTRY:
reusableBuffer.calib.state = 0; reusableBuffer.calib.state = 0;
@ -1524,7 +1524,7 @@ void menuCommonCalib(uint8_t event)
case 1: case 1:
// SET MIDPOINT // SET MIDPOINT
lcd_putsAtt(0*FW, 2*FH, STR_SETMIDPOINT, s_noScroll ? INVERS : 0); lcd_putsAtt(0*FW, 2*FH, STR_SETMIDPOINT, INVERS);
lcd_putsLeft(3*FH, STR_MENUWHENDONE); lcd_putsLeft(3*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) { for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {
@ -1543,7 +1543,7 @@ void menuCommonCalib(uint8_t event)
case 2: case 2:
// MOVE STICKS/POTS // MOVE STICKS/POTS
STICK_SCROLL_DISABLE(); STICK_SCROLL_DISABLE();
lcd_putsAtt(0*FW, 2*FH, STR_MOVESTICKSPOTS, s_noScroll ? INVERS : 0); lcd_putsAtt(0*FW, 2*FH, STR_MOVESTICKSPOTS, INVERS);
lcd_putsLeft(3*FH, STR_MENUWHENDONE); lcd_putsLeft(3*FH, STR_MENUWHENDONE);
for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) { for (uint8_t i=0; i<NUM_STICKS+NUM_POTS; i++) {

View file

@ -39,7 +39,7 @@
vertpos_t s_pgOfs; vertpos_t s_pgOfs;
int8_t s_editMode; int8_t s_editMode;
uint8_t s_noHi; uint8_t s_noHi;
uint8_t s_noScroll; uint8_t calibrationState;
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr) void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr)
{ {
@ -394,7 +394,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
uint8_t attr = 0; uint8_t attr = 0;
int8_t cc = curr; int8_t cc = curr;
switch(event) { switch (event) {
case EVT_KEY_LONG(KEY_MENU): case EVT_KEY_LONG(KEY_MENU):
if (menuTab == menuTabModel) { if (menuTab == menuTabModel) {
killEvents(event); killEvents(event);
@ -430,7 +430,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
return false; return false;
} }
s_noScroll = 0; calibrationState = 0;
if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) { if (!(flags&CHECK_FLAG_NO_SCREEN_INDEX)) {
displayScreenIndex(curr, menuTabSize, attr); displayScreenIndex(curr, menuTabSize, attr);
@ -701,7 +701,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
uint8_t attr = 0; uint8_t attr = 0;
if (l_posVert==0 && !s_noScroll) { if (l_posVert==0 && !calibrationState) {
attr = INVERS; attr = INVERS;
int8_t cc = curr; int8_t cc = curr;
@ -761,7 +761,7 @@ bool check(check_event_t event, uint8_t curr, const MenuFuncP *menuTab, uint8_t
#endif #endif
} }
s_noScroll = 0; calibrationState = 0;
displayScreenIndex(curr, menuTabSize, attr); displayScreenIndex(curr, menuTabSize, attr);
} }

View file

@ -96,7 +96,7 @@ extern vertpos_t m_posVert;
extern horzpos_t m_posHorz; extern horzpos_t m_posHorz;
extern vertpos_t s_pgOfs; extern vertpos_t s_pgOfs;
extern uint8_t s_noHi; extern uint8_t s_noHi;
extern uint8_t s_noScroll; extern uint8_t calibrationState;
void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr); void menu_lcd_onoff(uint8_t x, uint8_t y, uint8_t value, LcdFlags attr);

View file

@ -434,7 +434,7 @@ void evalInputs(uint8_t mode)
if (mode == e_perout_mode_normal) { if (mode == e_perout_mode_normal) {
if (tmp==0 || (tmp==1 && (bpanaCenter & mask))) { if (tmp==0 || (tmp==1 && (bpanaCenter & mask))) {
anaCenter |= mask; anaCenter |= mask;
if ((g_model.beepANACenter & mask) && !(bpanaCenter & mask)) { if ((g_model.beepANACenter & mask) && !(bpanaCenter & mask) && !calibrationState) {
AUDIO_POT_MIDDLE(i); AUDIO_POT_MIDDLE(i);
} }
} }

View file

@ -1385,16 +1385,16 @@ void getADC()
temp[x] += Analog_values[x]; temp[x] += Analog_values[x];
} }
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
if (s_noScroll) break; if (calibrationState) break;
#endif #endif
} }
for (uint32_t x=0; x<NUMBER_ANALOG; x++) { for (uint32_t x=0; x<NUMBER_ANALOG; x++) {
uint16_t v = temp[x] >> 3; uint16_t v = temp[x] >> 3;
#if defined(PCBTARANIS) #if defined(PCBTARANIS)
if (s_noScroll) v = temp[x] >> 1; if (calibrationState) v = temp[x] >> 1;
StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x]; StepsCalibData * calib = (StepsCalibData *) &g_eeGeneral.calib[x];
if (!s_noScroll && IS_POT_MULTIPOS(x) && calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) { if (!calibrationState && IS_POT_MULTIPOS(x) && calib->count>0 && calib->count<XPOTS_MULTIPOS_COUNT) {
uint8_t vShifted = (v >> 4); uint8_t vShifted = (v >> 4);
s_anaFilt[x] = 2*RESX; s_anaFilt[x] = 2*RESX;
for (int i=0; i<calib->count; i++) { for (int i=0; i<calib->count; i++) {