mirror of
https://github.com/opentx/opentx.git
synced 2025-07-23 16:25:16 +03:00
Fixes #1323
This commit is contained in:
parent
e8e2ff4a94
commit
b1f44d7101
15 changed files with 25 additions and 22 deletions
|
@ -3850,8 +3850,8 @@ void onLimitsMenu(const char *result)
|
||||||
ld->revert = false;
|
ld->revert = false;
|
||||||
ld->curve = 0;
|
ld->curve = 0;
|
||||||
}
|
}
|
||||||
else if (result == STR_COPY_TRIMS_TO_OFS) {
|
else if (result == STR_COPY_STICKS_TO_OFS) {
|
||||||
copyTrimsToOffset(ch);
|
copySticksToOffset(ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -3929,7 +3929,7 @@ void menuModelLimits(uint8_t event)
|
||||||
if (sub==k && m_posHorz < 0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
if (sub==k && m_posHorz < 0 && event==EVT_KEY_LONG(KEY_ENTER)) {
|
||||||
killEvents(event);
|
killEvents(event);
|
||||||
MENU_ADD_ITEM(STR_RESET);
|
MENU_ADD_ITEM(STR_RESET);
|
||||||
MENU_ADD_ITEM(STR_COPY_TRIMS_TO_OFS);
|
MENU_ADD_ITEM(STR_COPY_STICKS_TO_OFS);
|
||||||
menuHandler = onLimitsMenu;
|
menuHandler = onLimitsMenu;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -3965,7 +3965,7 @@ void menuModelLimits(uint8_t event)
|
||||||
ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL|NO_INCDEC_MARKS|DBLKEYS_1000);
|
ld->offset = checkIncDec(event, ld->offset, -1000, 1000, EE_MODEL|NO_INCDEC_MARKS|DBLKEYS_1000);
|
||||||
}
|
}
|
||||||
else if (attr && event==EVT_KEY_LONG(KEY_MENU)) {
|
else if (attr && event==EVT_KEY_LONG(KEY_MENU)) {
|
||||||
copyTrimsToOffset(k);
|
copySticksToOffset(k);
|
||||||
s_editMode = 0;
|
s_editMode = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -3050,24 +3050,27 @@ void instantTrim()
|
||||||
AUDIO_WARNING2();
|
AUDIO_WARNING2();
|
||||||
}
|
}
|
||||||
|
|
||||||
void copyTrimsToOffset(uint8_t ch)
|
void copySticksToOffset(uint8_t ch)
|
||||||
{
|
{
|
||||||
pauseMixerCalculations();
|
pauseMixerCalculations();
|
||||||
int32_t zero = (int32_t)channelOutputs[ch];
|
int32_t zero = (int32_t)channelOutputs[ch];
|
||||||
|
int32_t old = chans[ch];
|
||||||
|
|
||||||
evalFlightModeMixes(e_perout_mode_nosticks+e_perout_mode_notrainer, 0);
|
evalFlightModeMixes(e_perout_mode_nosticks+e_perout_mode_notrainer, 0);
|
||||||
int32_t val = chans[ch];
|
int32_t val = chans[ch];
|
||||||
LimitData *ld = limitAddress(ch);
|
LimitData *ld = limitAddress(ch);
|
||||||
limit_min_max_t lim = LIMIT_MAX(ld);
|
limit_min_max_t lim = LIMIT_MIN(ld);
|
||||||
|
TRACE("%d vs %d chan=%d vs %d - lim=%d", zero, channelOutputs[ch], val, old, lim);
|
||||||
if (val < 0) {
|
if (val < 0) {
|
||||||
val = -val;
|
val = -val;
|
||||||
lim = LIMIT_MIN(ld);
|
lim = LIMIT_MIN(ld);
|
||||||
}
|
}
|
||||||
#if defined(CPUARM)
|
#if defined(CPUARM)
|
||||||
zero = (zero*100000 - val*lim) / (102400-val);
|
zero = (zero*256000 - val*lim) / (1024*256-val);
|
||||||
#else
|
#else
|
||||||
zero = (zero*100000 - 10*val*lim) / (102400-val);
|
zero = (zero*256000 - 10*val*lim) / (1024*256-val);
|
||||||
#endif
|
#endif
|
||||||
ld->offset = (ld->revert) ? -zero : zero;
|
ld->offset = (ld->revert ? -zero : zero);
|
||||||
resumeMixerCalculations();
|
resumeMixerCalculations();
|
||||||
eeDirty(EE_MODEL);
|
eeDirty(EE_MODEL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1176,7 +1176,7 @@ void applyDefaultTemplate();
|
||||||
void incSubtrim(uint8_t idx, int16_t inc);
|
void incSubtrim(uint8_t idx, int16_t inc);
|
||||||
void instantTrim();
|
void instantTrim();
|
||||||
FORCEINLINE void evalTrims();
|
FORCEINLINE void evalTrims();
|
||||||
void copyTrimsToOffset(uint8_t ch);
|
void copySticksToOffset(uint8_t ch);
|
||||||
void moveTrimsToOffsets();
|
void moveTrimsToOffsets();
|
||||||
|
|
||||||
void evalFunctions();
|
void evalFunctions();
|
||||||
|
|
|
@ -519,7 +519,7 @@ const pm_char STR_BLCOLOR[] PROGMEM = TR_BLCOLOR;
|
||||||
const pm_char STR_PT[] PROGMEM = TR_PT;
|
const pm_char STR_PT[] PROGMEM = TR_PT;
|
||||||
const pm_char STR_PTS[] PROGMEM = TR_PTS;
|
const pm_char STR_PTS[] PROGMEM = TR_PTS;
|
||||||
const pm_char STR_SMOOTH[] PROGMEM = TR_SMOOTH;
|
const pm_char STR_SMOOTH[] PROGMEM = TR_SMOOTH;
|
||||||
const pm_char STR_COPY_TRIMS_TO_OFS[] PROGMEM = TR_COPY_TRIMS_TO_OFS;
|
const pm_char STR_COPY_STICKS_TO_OFS[] PROGMEM = TR_COPY_STICKS_TO_OFS;
|
||||||
const pm_char STR_TOP_BAR[] PROGMEM = TR_TOP_BAR;
|
const pm_char STR_TOP_BAR[] PROGMEM = TR_TOP_BAR;
|
||||||
const pm_char STR_ALTITUDE[] PROGMEM = TR_ALTITUDE;
|
const pm_char STR_ALTITUDE[] PROGMEM = TR_ALTITUDE;
|
||||||
const pm_char STR_SCALE[] PROGMEM = TR_SCALE;
|
const pm_char STR_SCALE[] PROGMEM = TR_SCALE;
|
||||||
|
|
|
@ -700,7 +700,7 @@ extern const pm_char STR_BLCOLOR[];
|
||||||
extern const pm_char STR_PT[];
|
extern const pm_char STR_PT[];
|
||||||
extern const pm_char STR_PTS[];
|
extern const pm_char STR_PTS[];
|
||||||
extern const pm_char STR_SMOOTH[];
|
extern const pm_char STR_SMOOTH[];
|
||||||
extern const pm_char STR_COPY_TRIMS_TO_OFS[];
|
extern const pm_char STR_COPY_STICKS_TO_OFS[];
|
||||||
extern const pm_char STR_TOP_BAR[];
|
extern const pm_char STR_TOP_BAR[];
|
||||||
extern const pm_char STR_ALTITUDE[];
|
extern const pm_char STR_ALTITUDE[];
|
||||||
extern const pm_char STR_SCALE[];
|
extern const pm_char STR_SCALE[];
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "č."
|
#define TR_PT "č."
|
||||||
#define TR_PTS " b."
|
#define TR_PTS " b."
|
||||||
#define TR_SMOOTH "Hladká"
|
#define TR_SMOOTH "Hladká"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Kopírovat trim do subtrimu"
|
#define TR_COPY_STICKS_TO_OFS "Kopírovat stick do subtrimu"
|
||||||
#define TR_PERSISTENT_MAH TR(INDENT "Str mAh", INDENT "Ukládat mAh")
|
#define TR_PERSISTENT_MAH TR(INDENT "Str mAh", INDENT "Ukládat mAh")
|
||||||
#define TR_PREFLIGHT "Předletová kontrola"
|
#define TR_PREFLIGHT "Předletová kontrola"
|
||||||
#define TR_CHECKLIST INDENT "Zobrazit poznámky"
|
#define TR_CHECKLIST INDENT "Zobrazit poznámky"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "Pt"
|
#define TR_PT "Pt"
|
||||||
#define TR_PTS "Pts"
|
#define TR_PTS "Pts"
|
||||||
#define TR_SMOOTH "Runden"
|
#define TR_SMOOTH "Runden"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Kopie Trim to Servo-Mitte" // "Trims => Offset"
|
#define TR_COPY_STICKS_TO_OFS "Kopie Stick to Servo-Mitte" // "Trims => Offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Speichern mAh"
|
#define TR_PERSISTENT_MAH INDENT "Speichern mAh"
|
||||||
#define TR_PREFLIGHT "----Preflight Checks----"
|
#define TR_PREFLIGHT "----Preflight Checks----"
|
||||||
#define TR_CHECKLIST INDENT "Display Checklist"
|
#define TR_CHECKLIST INDENT "Display Checklist"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pts"
|
#define TR_PTS "pts"
|
||||||
#define TR_SMOOTH "Smooth"
|
#define TR_SMOOTH "Smooth"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Copy Trim To Subtrim"
|
#define TR_COPY_STICKS_TO_OFS "Copy Stick To Subtrim"
|
||||||
#define TR_PERSISTENT_MAH TR(INDENT "Str mAh", INDENT "Persistent mAh")
|
#define TR_PERSISTENT_MAH TR(INDENT "Str mAh", INDENT "Persistent mAh")
|
||||||
#define TR_PREFLIGHT "Preflight Checks"
|
#define TR_PREFLIGHT "Preflight Checks"
|
||||||
#define TR_CHECKLIST TR(INDENT "Checklist", INDENT "Display Checklist")
|
#define TR_CHECKLIST TR(INDENT "Checklist", INDENT "Display Checklist")
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pts"
|
#define TR_PTS "pts"
|
||||||
#define TR_SMOOTH "Smooth"
|
#define TR_SMOOTH "Smooth"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Copy Trims To Offset"
|
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Valor mAh"
|
#define TR_PERSISTENT_MAH INDENT "Valor mAh"
|
||||||
#define TR_PREFLIGHT "Preflight Checks"
|
#define TR_PREFLIGHT "Preflight Checks"
|
||||||
#define TR_CHECKLIST INDENT "Display Checklist"
|
#define TR_CHECKLIST INDENT "Display Checklist"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pts"
|
#define TR_PTS "pts"
|
||||||
#define TR_SMOOTH "Smooth"
|
#define TR_SMOOTH "Smooth"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Copy Trims To Offset"
|
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Store mAh"
|
#define TR_PERSISTENT_MAH INDENT "Store mAh"
|
||||||
#define TR_PREFLIGHT "Preflight Checks"
|
#define TR_PREFLIGHT "Preflight Checks"
|
||||||
#define TR_CHECKLIST INDENT "Display Checklist"
|
#define TR_CHECKLIST INDENT "Display Checklist"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pts"
|
#define TR_PTS "pts"
|
||||||
#define TR_SMOOTH "Lissage"
|
#define TR_SMOOTH "Lissage"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Trim vers subtrim"
|
#define TR_COPY_STICKS_TO_OFS "Manche vers subtrim"
|
||||||
#define TR_PERSISTENT_MAH TR(INDENT "Enr. mAh", INDENT "Enregistrer mAh")
|
#define TR_PERSISTENT_MAH TR(INDENT "Enr. mAh", INDENT "Enregistrer mAh")
|
||||||
#define TR_PREFLIGHT "Vérifications avant vol"
|
#define TR_PREFLIGHT "Vérifications avant vol"
|
||||||
#define TR_CHECKLIST TR(INDENT "Notes", INDENT "Afficher notes")
|
#define TR_CHECKLIST TR(INDENT "Notes", INDENT "Afficher notes")
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pti"
|
#define TR_PTS "pti"
|
||||||
#define TR_SMOOTH "Smussa"
|
#define TR_SMOOTH "Smussa"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Copia Trim su Offset"
|
#define TR_COPY_STICKS_TO_OFS "Copia Stick su Offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Memo mAh"
|
#define TR_PERSISTENT_MAH INDENT "Memo mAh"
|
||||||
#define TR_PREFLIGHT "Controlli Prevolo"
|
#define TR_PREFLIGHT "Controlli Prevolo"
|
||||||
#define TR_CHECKLIST INDENT "Mostra Checklist"
|
#define TR_CHECKLIST INDENT "Mostra Checklist"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pkt"
|
#define TR_PT "pkt"
|
||||||
#define TR_PTS "pkty"
|
#define TR_PTS "pkty"
|
||||||
#define TR_SMOOTH "Gładka"
|
#define TR_SMOOTH "Gładka"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Skopiuj Trymery Do Offsetu"
|
#define TR_COPY_STICKS_TO_OFS "Skopiuj Stick Do Offsetu"
|
||||||
#define TR_PERSISTENT_MAH TR(INDENT "Zap. mAh", INDENT "Zapisz mAh")
|
#define TR_PERSISTENT_MAH TR(INDENT "Zap. mAh", INDENT "Zapisz mAh")
|
||||||
#define TR_PREFLIGHT "Lista Ostrzeżeń"
|
#define TR_PREFLIGHT "Lista Ostrzeżeń"
|
||||||
#define TR_CHECKLIST TR(INDENT "Czeklista",INDENT "Pokaż Listę Ostrzeżeń")
|
#define TR_CHECKLIST TR(INDENT "Czeklista",INDENT "Pokaż Listę Ostrzeżeń")
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pts"
|
#define TR_PTS "pts"
|
||||||
#define TR_SMOOTH "Smooth"
|
#define TR_SMOOTH "Smooth"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Copy Trims To Offset"
|
#define TR_COPY_STICKS_TO_OFS "Copy Sticks To Offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Store mAh"
|
#define TR_PERSISTENT_MAH INDENT "Store mAh"
|
||||||
#define TR_PREFLIGHT "Preflight Checks"
|
#define TR_PREFLIGHT "Preflight Checks"
|
||||||
#define TR_CHECKLIST INDENT "Display Checklist"
|
#define TR_CHECKLIST INDENT "Display Checklist"
|
||||||
|
|
|
@ -803,7 +803,7 @@
|
||||||
#define TR_PT "pt"
|
#define TR_PT "pt"
|
||||||
#define TR_PTS "pkt"
|
#define TR_PTS "pkt"
|
||||||
#define TR_SMOOTH "Mjuk"
|
#define TR_SMOOTH "Mjuk"
|
||||||
#define TR_COPY_TRIMS_TO_OFS "Spara trimmar som offset"
|
#define TR_COPY_STICKS_TO_OFS "Spara sticks som offset"
|
||||||
#define TR_PERSISTENT_MAH INDENT "Lagra mAh"
|
#define TR_PERSISTENT_MAH INDENT "Lagra mAh"
|
||||||
#define TR_PREFLIGHT "Startkontroller"
|
#define TR_PREFLIGHT "Startkontroller"
|
||||||
#define TR_CHECKLIST TR(INDENT "Checklista", INDENT "Visa Checklista")
|
#define TR_CHECKLIST TR(INDENT "Checklista", INDENT "Visa Checklista")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue