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

[Horus] Next round of screen changes + refactoring

This commit is contained in:
Bertrand Songis 2015-11-03 19:53:55 +01:00
parent 8f4c161dc0
commit a556c50956
106 changed files with 1848 additions and 1195 deletions

View file

@ -161,8 +161,7 @@ char *strcat_zchar(char * dest, const char * name, uint8_t size, const char *def
#endif
#endif
#if defined(COLORLCD)
char *strAppendDigits(char *dest, int value)
char * strAppendNumber(char * dest, unsigned int value)
{
div_t qr = div(value, 10);
*dest++ = '0' + qr.quot;
@ -170,10 +169,9 @@ char *strAppendDigits(char *dest, int value)
*dest = '\0';
return dest;
}
#endif
#if defined(CPUARM) || defined(SDCARD)
char *strAppend(char *dest, const char *source, int len)
char * strAppend(char * dest, const char * source, int len)
{
while ((*dest++ = *source++)) {
if (--len == 0) {
@ -184,7 +182,7 @@ char *strAppend(char *dest, const char *source, int len)
return dest - 1;
}
char *strSetCursor(char *dest, int position)
char * strSetCursor(char * dest, int position)
{
*dest++ = 0x1F;
*dest++ = position;
@ -192,7 +190,7 @@ char *strSetCursor(char *dest, int position)
return dest;
}
char *strAppendFilename(char *dest, const char *filename, const int size)
char * strAppendFilename(char *dest, const char *filename, const int size)
{
memset(dest, 0, size);
for (int i=0; i<size; i++) {
@ -204,18 +202,6 @@ char *strAppendFilename(char *dest, const char *filename, const int size)
return dest;
}
#define LEN_FILE_EXTENSION 4
char *getFileExtension(char *filename, int size)
{
int len = min<int>(size, strlen(filename));
for (int i=len; i>=len-LEN_FILE_EXTENSION; --i) {
if (filename[i] == '.') {
return &filename[i];
}
}
return NULL;
}
#if defined(RTCLOCK)
#include "rtc.h"