Merge pull request #1312 from opentx/projectkk2glider/issue_115

Fixes issue #115
This commit is contained in:
Bertrand Songis
2014-06-19 07:31:03 +02:00
3 changed files with 14 additions and 3 deletions
+6 -1
View File
@@ -582,7 +582,7 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
len = i+1; len = i+1;
if (len) { if (len) {
if (buf[i]) if (buf[i])
buf[i] = idx2char(buf[i]); buf[i] = idx2char(buf[i]);
else else
buf[i] = '_'; buf[i] = '_';
} }
@@ -597,6 +597,11 @@ const pm_char * eeBackupModel(uint8_t i_fileSrc)
len = sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 2; len = sizeof(MODELS_PATH) + PSIZE(TR_MODEL) + 2;
} }
#if defined(RTCLOCK)
char * tmp = strAppendDate(&buf[len], true);
len = tmp - buf;
#endif
strcpy_P(&buf[len], STR_MODELS_EXT); strcpy_P(&buf[len], STR_MODELS_EXT);
#ifdef SIMU #ifdef SIMU
+1 -1
View File
@@ -1514,7 +1514,7 @@ union ReusableBuffer
uint16_t eepromfree; uint16_t eepromfree;
#if defined(SDCARD) #if defined(SDCARD)
char menu_bss[MENU_MAX_LINES][MENU_LINE_LENGTH]; char menu_bss[MENU_MAX_LINES][MENU_LINE_LENGTH];
char mainname[42]; // because reused for SD backup / restore char mainname[45]; // because reused for SD backup / restore, max backup filename 44 chars: "/MODELS/MODEL0134353-2014-06-19-04-51-27.bin"
#else #else
char mainname[LEN_MODEL_NAME]; char mainname[LEN_MODEL_NAME];
#endif #endif
+7 -1
View File
@@ -39,6 +39,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <sys/stat.h> #include <sys/stat.h>
#if defined(RTCLOCK)
#include <time.h>
#endif
#if defined WIN32 || !defined __GNUC__ #if defined WIN32 || !defined __GNUC__
#include <direct.h> #include <direct.h>
@@ -352,7 +355,10 @@ void StartMainThread(bool tests)
#endif #endif
g_tmr10ms = 0; g_tmr10ms = 0;
#if defined(RTCLOCK)
g_rtcTime = time(0);
#endif
main_thread_running = (tests ? 1 : 2); main_thread_running = (tests ? 1 : 2);
pthread_create(&main_thread_pid, NULL, &main_thread, NULL); pthread_create(&main_thread_pid, NULL, &main_thread, NULL);
} }