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

Cosmetics

This commit is contained in:
Bertrand Songis 2016-08-21 12:41:12 +02:00
parent cd2b6b3864
commit b657ca1862
28 changed files with 122 additions and 97 deletions

View file

@ -160,6 +160,36 @@ char * getStringWithIndex(char * dest, const char * s, int idx)
return dest;
}
char * getTimerString(char * dest, putstime_t tme, uint8_t hours)
{
char * s = dest;
div_t qr;
if (tme < 0) {
tme = -tme;
*s++ = '-';
}
qr = div(tme, 60);
if (hours) {
div_t qr2 = div(qr.quot, 60);
*s++ = '0' + (qr2.quot / 10);
*s++ = '0' + (qr2.quot % 10);
*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;
}
char * getCurveString(char * dest, int idx)
{
if (idx == 0) {