mirror of
https://github.com/opentx/opentx.git
synced 2025-07-14 11:59:50 +03:00
parent
fd16151850
commit
3d17023bc9
1 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue