mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 00:05:17 +03:00
Steps of 10 during key repeats for telemetry values - was awfully long now we have more resolution
This commit is contained in:
parent
1f6e5544b8
commit
c41c7469b8
4 changed files with 16 additions and 2 deletions
|
@ -4361,6 +4361,7 @@ void menuModelLogicalSwitchOne(uint8_t event)
|
|||
putsTelemetryChannel(CSWONE_2ND_COLUMN, y, v1_val - MIXSRC_FIRST_TELEM, convertCswTelemValue(cs), attr|LEFT);
|
||||
v2_max = maxTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
||||
v2_min = minTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
||||
INCDEC_SET_FLAG(INCDEC_REP10 | NO_INCDEC_MARKS);
|
||||
if (cs->v2 < v2_min || cs->v2 > v2_max) {
|
||||
cs->v2 = 0;
|
||||
eeDirty(EE_MODEL);
|
||||
|
@ -4645,6 +4646,7 @@ void menuModelLogicalSwitches(uint8_t event)
|
|||
v2_max = maxTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
||||
#if defined(CPUARM)
|
||||
v2_min = minTelemValue(v1_val - MIXSRC_FIRST_TELEM + 1);
|
||||
INCDEC_SET_FLAG(INCDEC_REP10 | NO_INCDEC_MARKS);
|
||||
if (cs->v2 < v2_min || cs->v2 > v2_max) {
|
||||
cs->v2 = 0;
|
||||
eeDirty(EE_MODEL);
|
||||
|
|
|
@ -165,7 +165,12 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
|
|||
#endif
|
||||
#if defined(CPUARM)
|
||||
do {
|
||||
newval++;
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval+=10;
|
||||
}
|
||||
else {
|
||||
newval++;
|
||||
}
|
||||
} while (isValueAvailable && !isValueAvailable(newval) && newval<=i_max);
|
||||
if (newval > i_max) {
|
||||
newval = val;
|
||||
|
@ -185,7 +190,12 @@ int16_t checkIncDec(uint8_t event, int16_t val, int16_t i_min, int16_t i_max, ui
|
|||
#endif
|
||||
#if defined(CPUARM)
|
||||
do {
|
||||
newval--;
|
||||
if (IS_KEY_REPT(event) && (i_flags & INCDEC_REP10)) {
|
||||
newval-=10;
|
||||
}
|
||||
else {
|
||||
newval--;
|
||||
}
|
||||
} while (isValueAvailable && !isValueAvailable(newval) && newval>=i_min);
|
||||
if (newval < i_min) {
|
||||
newval = val;
|
||||
|
|
|
@ -170,6 +170,7 @@ extern int8_t s_editMode; // global editmode
|
|||
#define INCDEC_SWITCH 0x08
|
||||
#define INCDEC_SOURCE 0x10
|
||||
#define DBLKEYS_1000 0x20
|
||||
#define INCDEC_REP10 0x40
|
||||
|
||||
// mawrow special values
|
||||
#define TITLE_ROW ((uint8_t)-1)
|
||||
|
|
|
@ -130,6 +130,7 @@ enum EnumKeys {
|
|||
#define IS_KEY_BREAK(evt) (((evt)&0xe0) == _MSK_KEY_BREAK)
|
||||
#define IS_KEY_FIRST(evt) (((evt)&0xe0) == _MSK_KEY_FIRST)
|
||||
#define IS_KEY_LONG(evt) (((evt)&0xe0) == _MSK_KEY_LONG)
|
||||
#define IS_KEY_REPT(evt) (((evt)&0xe0) == _MSK_KEY_REPT)
|
||||
|
||||
#define EVT_ENTRY 0xbf
|
||||
#define EVT_ENTRY_UP 0xbe
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue