[X7] SH fix - #4143
This commit is contained in:
@@ -150,8 +150,6 @@ int checkIncDec(event_t event, int val, int i_min, int i_max, unsigned int i_fla
|
|||||||
int16_t checkIncDec(event_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags=0);
|
int16_t checkIncDec(event_t event, int16_t i_pval, int16_t i_min, int16_t i_max, uint8_t i_flags=0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int8_t checkIncDecMovedSwitch(int8_t val);
|
|
||||||
|
|
||||||
#if defined(CPUM64)
|
#if defined(CPUM64)
|
||||||
int8_t checkIncDecModel(event_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
int8_t checkIncDecModel(event_t event, int8_t i_val, int8_t i_min, int8_t i_max);
|
||||||
int8_t checkIncDecModelZero(event_t event, int8_t i_val, int8_t i_max);
|
int8_t checkIncDecModelZero(event_t event, int8_t i_val, int8_t i_max);
|
||||||
|
|||||||
@@ -35,22 +35,6 @@ int16_t p1valdiff;
|
|||||||
int8_t p2valdiff;
|
int8_t p2valdiff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AUTOSWITCH)
|
|
||||||
int8_t checkIncDecMovedSwitch(int8_t val)
|
|
||||||
{
|
|
||||||
if (s_editMode>0) {
|
|
||||||
int8_t swtch = getMovedSwitch();
|
|
||||||
if (swtch) {
|
|
||||||
if (IS_CONFIG_TOGGLE(swtch) && swtch==val)
|
|
||||||
val = -val;
|
|
||||||
else
|
|
||||||
val = swtch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int8_t checkIncDec_Ret;
|
int8_t checkIncDec_Ret;
|
||||||
|
|
||||||
#if defined(PCBX7)
|
#if defined(PCBX7)
|
||||||
|
|||||||
@@ -27,28 +27,6 @@ int8_t s_editMode;
|
|||||||
uint8_t noHighlightCounter;
|
uint8_t noHighlightCounter;
|
||||||
uint8_t menuCalibrationState;
|
uint8_t menuCalibrationState;
|
||||||
int checkIncDecSelection = 0;
|
int checkIncDecSelection = 0;
|
||||||
|
|
||||||
#if defined(AUTOSWITCH)
|
|
||||||
swsrc_t checkIncDecMovedSwitch(swsrc_t val)
|
|
||||||
{
|
|
||||||
if (s_editMode > 0) {
|
|
||||||
swsrc_t swtch = getMovedSwitch();
|
|
||||||
if (swtch) {
|
|
||||||
div_t info = switchInfo(swtch);
|
|
||||||
if (IS_CONFIG_TOGGLE(info.quot)) {
|
|
||||||
if (info.rem != 0) {
|
|
||||||
val = (val == swtch ? swtch-2 : swtch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
val = swtch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return val;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int8_t checkIncDec_Ret;
|
int8_t checkIncDec_Ret;
|
||||||
|
|
||||||
INIT_STOPS(stops100, 3, -100, 0, 100)
|
INIT_STOPS(stops100, 3, -100, 0, 100)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ set(GUI_SRC
|
|||||||
set(SRC
|
set(SRC
|
||||||
${SRC}
|
${SRC}
|
||||||
gui/common/widgets.cpp
|
gui/common/widgets.cpp
|
||||||
|
gui/common/navigation.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(gui gui/${GUI_DIR})
|
include_directories(gui gui/${GUI_DIR})
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) OpenTX
|
||||||
|
*
|
||||||
|
* Based on code named
|
||||||
|
* th9x - http://code.google.com/p/th9x
|
||||||
|
* er9x - http://code.google.com/p/er9x
|
||||||
|
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||||
|
*
|
||||||
|
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "opentx.h"
|
||||||
|
|
||||||
|
#if defined(AUTOSWITCH)
|
||||||
|
swsrc_t checkIncDecMovedSwitch(swsrc_t val)
|
||||||
|
{
|
||||||
|
if (s_editMode>0) {
|
||||||
|
swsrc_t swtch = getMovedSwitch();
|
||||||
|
if (swtch) {
|
||||||
|
#if defined(PCBTARANIS) || defined(PCBHORUS)
|
||||||
|
div_t info = switchInfo(swtch);
|
||||||
|
if (IS_CONFIG_TOGGLE(info.quot)) {
|
||||||
|
if (info.rem != 0) {
|
||||||
|
val = (val == swtch ? swtch-2 : swtch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = swtch;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
if (IS_CONFIG_TOGGLE(swtch) && swtch==val) {
|
||||||
|
val = -val;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
val = swtch;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -86,6 +86,8 @@ bool isSwitchWarningStateAvailable(int state);
|
|||||||
void drawFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
void drawFlightMode(coord_t x, coord_t y, int8_t idx, LcdFlags att=0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
swsrc_t checkIncDecMovedSwitch(swsrc_t val);
|
||||||
|
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
#include "telemetry/telemetry_sensors.h"
|
#include "telemetry/telemetry_sensors.h"
|
||||||
void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags flags);
|
void drawValueWithUnit(coord_t x, coord_t y, int32_t val, uint8_t unit, LcdFlags flags);
|
||||||
|
|||||||
Reference in New Issue
Block a user