1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-14 11:59:50 +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;
div_t qr;
if (tme < 0) {
tme = -tme;
*s++ = '-';
}
qr = div((int)tme, 60);
if (hours) {
div_t qr2 = div(qr.quot, 60);
*s++ = '0' + (qr2.quot / 10);
@ -178,14 +178,14 @@ char * getTimerString(char * dest, putstime_t tme, uint8_t hours)
*s++ = ':';
qr.quot = qr2.rem;
}
*s++ = '0' + (qr.quot / 10);
*s++ = '0' + (qr.quot % 10);
*s++ = ':';
*s++ = '0' + (qr.rem / 10);
*s++ = '0' + (qr.rem % 10);
*s = '\0';
return dest;
}
@ -194,18 +194,18 @@ char * getCurveString(char * dest, int idx)
if (idx == 0) {
return getStringAtIndex(dest, STR_MMMINV, 0);
}
char * s = dest;
if (idx < 0) {
*s++ = '!';
idx = -idx;
}
if (ZEXIST(g_model.curves[idx - 1].name))
zchar2str(s, g_model.curves[idx - 1].name, LEN_CURVE_NAME);
else
strAppendStringWithIndex(s, STR_CV, idx);
return dest;
}
@ -233,13 +233,13 @@ char * getSwitchString(char * dest, swsrc_t idx)
else if (idx == SWSRC_OFF) {
return getStringAtIndex(dest, STR_OFFON, 0);
}
char * s = dest;
if (idx < 0) {
*s++ = '!';
idx = -idx;
}
#if defined(PCBSKY9X)
#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)
@ -325,7 +325,7 @@ char * getSourceString(char * dest, mixsrc_t idx)
dest[LEN_INPUT_NAME] = '\0';
}
else {
strAppendUnsigned(dest, idx, 2);
strAppendUnsigned(dest, idx+1, 2);
}
}
#if defined(LUA_INPUTS)
@ -389,7 +389,7 @@ char * getSourceString(char * dest, mixsrc_t idx)
if (qr.rem) dest[pos++] = (qr.rem==2 ? '+' : '-');
dest[pos] = '\0';
}
return dest;
}
#endif