Fixes #2934: shortened screen-shot file name (screen-2013-01-01-123540.bmp), also affects EEPROM backup which uses same time-stamp generation function.

This commit is contained in:
Damjan Adamic
2015-10-10 12:48:49 +02:00
parent f4dc2caedf
commit a30ddb7437
3 changed files with 10 additions and 11 deletions
+2 -1
View File
@@ -3,7 +3,8 @@
[AVR boards]
<ul>
<li>Fixed several problems with automatic playing of Physical and Logical Switches changes (eg LS15-on.wav, SG-mid.wav) (<a href=https://github.com/opentx/opentx/issues/2855>#2855</a>)</li>
<li>Sorce selector did not work in Telemetry screen for Bars (<a href=https://github.com/opentx/opentx/issues/2843>#2843</a>)</li>
<li>Source selector did not work in Telemetry screen for Bars (<a href=https://github.com/opentx/opentx/issues/2843>#2843</a>)</li>
<li>Shortened screen-shot file name (<a href=https://github.com/opentx/opentx/issues/2934>#2934</a>)</li>
</ul>
+2 -2
View File
@@ -227,7 +227,7 @@ const char *writeScreenshot()
{
FIL bmpFile;
UINT written;
char filename[48]; // /SCREENSHOTS/screenshot-2013-01-01-12-35-40.bmp
char filename[42]; // /SCREENSHOTS/screen-2013-01-01-123540.bmp
DIR folder;
// check and create folder here
@@ -240,7 +240,7 @@ const char *writeScreenshot()
return SDCARD_ERROR(result);
}
char *tmp = strAppend(&filename[sizeof(SCREENSHOTS_PATH)-1], "/screenshot");
char *tmp = strAppend(&filename[sizeof(SCREENSHOTS_PATH)-1], "/screen");
tmp = strAppendDate(tmp, true);
strcpy(tmp, BITMAPS_EXT);
+6 -8
View File
@@ -245,16 +245,14 @@ char * strAppendDate(char * str, bool time)
div_t qr = div(utm.tm_hour, 10);
str[13] = '0' + qr.rem;
str[12] = '0' + qr.quot;
str[14] = '-';
qr = div(utm.tm_min, 10);
str[16] = '0' + qr.rem;
str[15] = '0' + qr.quot;
str[17] = '-';
str[15] = '0' + qr.rem;
str[14] = '0' + qr.quot;
qr = div(utm.tm_sec, 10);
str[19] = '0' + qr.rem;
str[18] = '0' + qr.quot;
str[20] = '\0';
return &str[20];
str[17] = '0' + qr.rem;
str[16] = '0' + qr.quot;
str[18] = '\0';
return &str[18];
}
else {
str[11] = '\0';