mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Trims2Offsets feature is back
This commit is contained in:
parent
7f41efd74d
commit
423a394bb4
4 changed files with 17 additions and 10 deletions
|
@ -316,7 +316,7 @@ enum EnumKeys {
|
|||
#define CSWITCH_STR "---- v>ofs v<ofs |v|>ofs|v|<ofsAND OR XOR ""v1==v2 ""v1!=v2 ""v1>v2 ""v1<v2 ""v1>=v2 ""v1<=v2 "
|
||||
#define CSW_LEN_FUNC 7
|
||||
|
||||
#define FSWITCH_STR "---- ""Trainer ""Trainer RUD ""Trainer ELE ""Trainer THR ""Trainer AIL ""Instant Trim ""Telemetry View"
|
||||
#define FSWITCH_STR "---- ""Trainer ""Trainer RUD ""Trainer ELE ""Trainer THR ""Trainer AIL ""Instant Trim ""Trims2Offsets ""Telemetry View"
|
||||
#define FSW_LEN_FUNC 14
|
||||
|
||||
#define SWASH_TYPE_STR "--- ""120 ""120X ""140 ""90 "
|
||||
|
|
|
@ -50,6 +50,7 @@ void menuMainView(uint8_t event)
|
|||
{
|
||||
static uint8_t switchView = 255;
|
||||
static bool instantTrimSwLock;
|
||||
static bool trim2OfsSwLock;
|
||||
|
||||
uint8_t view = (switchView == 255 ? g_eeGeneral.view : switchView);
|
||||
|
||||
|
@ -149,6 +150,7 @@ void menuMainView(uint8_t event)
|
|||
killEvents(KEY_UP);
|
||||
killEvents(KEY_DOWN);
|
||||
instantTrimSwLock = true;
|
||||
trim2OfsSwLock = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -156,6 +158,10 @@ void menuMainView(uint8_t event)
|
|||
if (!instantTrimSwLock && trimSw) instantTrim();
|
||||
instantTrimSwLock = trimSw;
|
||||
|
||||
trimSw = isFunctionActive(FUNC_TRIMS_2_OFS);
|
||||
if (!trim2OfsSwLock && trimSw) moveTrimsToOffsets();
|
||||
trim2OfsSwLock = trimSw;
|
||||
|
||||
#ifdef FRSKY
|
||||
if (view_base == e_telemetry && view > ALTERNATE) {
|
||||
putsModelName(0, 0, g_model.name, g_eeGeneral.currModel, 0);
|
||||
|
|
|
@ -1114,29 +1114,29 @@ static uint8_t s_copySrcIdx;
|
|||
static uint8_t s_copySrcCh;
|
||||
|
||||
#define FIRST 0x10
|
||||
void displayMixerLine(uint8_t row, uint8_t mix, uint8_t ch, uint8_t idx, uint8_t cur, uint8_t event)
|
||||
inline void displayMixerLine(uint8_t row, uint8_t mix, uint8_t ch, uint8_t idx, uint8_t cur, uint8_t event)
|
||||
{
|
||||
uint8_t y = (row-s_pgOfs)*FH;
|
||||
MixData *md = mixaddress(mix);
|
||||
if (idx > 0)
|
||||
lcd_putsnAtt(FW, y, PSTR("+=*=:=")+md->mltpx*2, 2, 0);
|
||||
|
||||
putsChnRaw(4*FW, y, md->srcRaw, 0);
|
||||
putsChnRaw(4*FW+2, y, md->srcRaw, 0);
|
||||
|
||||
uint8_t attr = ((s_copyMode || cur != row) ? 0 : INVERS);
|
||||
lcd_outdezAtt(11*FW, y, md->weight, attr);
|
||||
lcd_outdezAtt(11*FW+7, y, md->weight, attr);
|
||||
if (attr != 0)
|
||||
CHECK_INCDEC_MODELVAR(event, md->weight, -125, 125);
|
||||
|
||||
if (md->curve) lcd_putsnAtt(12*FW, y, PSTR(CURV_STR)+md->curve*3, 3, 0);
|
||||
if (md->swtch) putsSwitches(16*FW+FW/2, y, md->swtch, 0);
|
||||
if (md->curve) lcd_putsnAtt(12*FW+7, y, PSTR(CURV_STR)+md->curve*3, 3, 0);
|
||||
if (md->swtch) putsSwitches(16*FW+6, y, md->swtch, 0);
|
||||
|
||||
char cs = ' ';
|
||||
if (md->speedDown || md->speedUp)
|
||||
cs = 'S';
|
||||
if ((md->delayUp || md->delayDown))
|
||||
cs = (cs =='S' ? '*' : 'D');
|
||||
lcd_putcAtt(20*FW+1, y, cs, 0);
|
||||
lcd_putcAtt(20*FW+3, y, cs, 0);
|
||||
|
||||
if (s_copyMode) {
|
||||
if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && mix == (s_copySrcIdx + (s_copyTgtOfs<0))) {
|
||||
|
@ -1151,7 +1151,7 @@ void displayMixerLine(uint8_t row, uint8_t mix, uint8_t ch, uint8_t idx, uint8_t
|
|||
}
|
||||
}
|
||||
|
||||
void displayExpoLine(uint8_t row, uint8_t expo, uint8_t ch, uint8_t idx, uint8_t cur, uint8_t event)
|
||||
inline void displayExpoLine(uint8_t row, uint8_t expo, uint8_t ch, uint8_t idx, uint8_t cur, uint8_t event)
|
||||
{
|
||||
uint8_t y = (row-s_pgOfs)*FH;
|
||||
ExpoData *ed = expoaddress(expo);
|
||||
|
|
|
@ -158,8 +158,9 @@ typedef struct t_SafetySwData { // Safety Switches data
|
|||
#define FUNC_TRAINER_THR 4
|
||||
#define FUNC_TRAINER_AIL 5
|
||||
#define FUNC_INSTANT_TRIM 6
|
||||
#define FUNC_VIEW_TELEMETRY 7
|
||||
#define FUNC_LAST 7
|
||||
#define FUNC_TRIMS_2_OFS 7
|
||||
#define FUNC_VIEW_TELEMETRY 8
|
||||
#define FUNC_LAST 8
|
||||
|
||||
typedef struct t_FuncSwData { // Function Switches data
|
||||
int8_t swtch; //input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue