1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-15 04:15:26 +03:00

Fixes numbering discrepancy for Horus inputs (#4967)

Fixes #4966
This commit is contained in:
3djc 2017-05-29 13:24:29 +02:00 committed by Andre Bernet
parent fd16151850
commit 3d17023bc9

View file

@ -163,14 +163,14 @@ char * getTimerString(char * dest, putstime_t tme, uint8_t hours)
{ {
char * s = dest; char * s = dest;
div_t qr; div_t qr;
if (tme < 0) { if (tme < 0) {
tme = -tme; tme = -tme;
*s++ = '-'; *s++ = '-';
} }
qr = div((int)tme, 60); qr = div((int)tme, 60);
if (hours) { if (hours) {
div_t qr2 = div(qr.quot, 60); div_t qr2 = div(qr.quot, 60);
*s++ = '0' + (qr2.quot / 10); *s++ = '0' + (qr2.quot / 10);
@ -178,14 +178,14 @@ char * getTimerString(char * dest, putstime_t tme, uint8_t hours)
*s++ = ':'; *s++ = ':';
qr.quot = qr2.rem; qr.quot = qr2.rem;
} }
*s++ = '0' + (qr.quot / 10); *s++ = '0' + (qr.quot / 10);
*s++ = '0' + (qr.quot % 10); *s++ = '0' + (qr.quot % 10);
*s++ = ':'; *s++ = ':';
*s++ = '0' + (qr.rem / 10); *s++ = '0' + (qr.rem / 10);
*s++ = '0' + (qr.rem % 10); *s++ = '0' + (qr.rem % 10);
*s = '\0'; *s = '\0';
return dest; return dest;
} }
@ -194,18 +194,18 @@ char * getCurveString(char * dest, int idx)
if (idx == 0) { if (idx == 0) {
return getStringAtIndex(dest, STR_MMMINV, 0); return getStringAtIndex(dest, STR_MMMINV, 0);
} }
char * s = dest; char * s = dest;
if (idx < 0) { if (idx < 0) {
*s++ = '!'; *s++ = '!';
idx = -idx; idx = -idx;
} }
if (ZEXIST(g_model.curves[idx - 1].name)) if (ZEXIST(g_model.curves[idx - 1].name))
zchar2str(s, g_model.curves[idx - 1].name, LEN_CURVE_NAME); zchar2str(s, g_model.curves[idx - 1].name, LEN_CURVE_NAME);
else else
strAppendStringWithIndex(s, STR_CV, idx); strAppendStringWithIndex(s, STR_CV, idx);
return dest; return dest;
} }
@ -233,13 +233,13 @@ char * getSwitchString(char * dest, swsrc_t idx)
else if (idx == SWSRC_OFF) { else if (idx == SWSRC_OFF) {
return getStringAtIndex(dest, STR_OFFON, 0); return getStringAtIndex(dest, STR_OFFON, 0);
} }
char * s = dest; char * s = dest;
if (idx < 0) { if (idx < 0) {
*s++ = '!'; *s++ = '!';
idx = -idx; idx = -idx;
} }
#if defined(PCBSKY9X) #if defined(PCBSKY9X)
#define IDX_TRIMS_IN_STR_VSWITCHES (1+SWSRC_LAST_SWITCH) #define IDX_TRIMS_IN_STR_VSWITCHES (1+SWSRC_LAST_SWITCH)
#define IDX_ON_IN_STR_VSWITCHES (IDX_TRIMS_IN_STR_VSWITCHES+SWSRC_LAST_TRIM-SWSRC_FIRST_TRIM+2) #define IDX_ON_IN_STR_VSWITCHES (IDX_TRIMS_IN_STR_VSWITCHES+SWSRC_LAST_TRIM-SWSRC_FIRST_TRIM+2)
@ -325,7 +325,7 @@ char * getSourceString(char * dest, mixsrc_t idx)
dest[LEN_INPUT_NAME] = '\0'; dest[LEN_INPUT_NAME] = '\0';
} }
else { else {
strAppendUnsigned(dest, idx, 2); strAppendUnsigned(dest, idx+1, 2);
} }
} }
#if defined(LUA_INPUTS) #if defined(LUA_INPUTS)
@ -389,7 +389,7 @@ char * getSourceString(char * dest, mixsrc_t idx)
if (qr.rem) dest[pos++] = (qr.rem==2 ? '+' : '-'); if (qr.rem) dest[pos++] = (qr.rem==2 ? '+' : '-');
dest[pos] = '\0'; dest[pos] = '\0';
} }
return dest; return dest;
} }
#endif #endif