Merge with latest 2.3

This commit is contained in:
Bertrand Songis
2019-12-13 12:30:02 +01:00
52 changed files with 10502 additions and 7011 deletions
+9 -5
View File
@@ -46,7 +46,7 @@ const char * logsOpen()
{
// Determine and set log file filename
FRESULT result;
char filename[34]; // /LOGS/modelnamexxx-2013-01-01.log
char filename[sizeof(LOGS_PATH) + LEN_MODEL_NAME + 16]; // /LOGS/modelnamexxxxxx_2013-01-01.log
if (!sdMounted())
return STR_NO_SDCARD;
@@ -61,13 +61,13 @@ const char * logsOpen()
return error;
}
filename[sizeof(LOGS_PATH)-1] = '/';
filename[sizeof(LOGS_PATH) - 1] = '/';
memcpy(&filename[sizeof(LOGS_PATH)], g_model.header.name, sizeof(g_model.header.name));
filename[sizeof(LOGS_PATH)+sizeof(g_model.header.name)] = '\0';
filename[sizeof(LOGS_PATH) + LEN_MODEL_NAME] = '\0';
uint8_t i = sizeof(LOGS_PATH)+sizeof(g_model.header.name)-1;
uint8_t i = sizeof(LOGS_PATH) + LEN_MODEL_NAME - 1;
uint8_t len = 0;
while (i>sizeof(LOGS_PATH)-1) {
while (i > sizeof(LOGS_PATH) - 1) {
if (!len && filename[i])
len = i+1;
if (len) {
@@ -197,6 +197,10 @@ void logsWrite()
{
static const char * error_displayed = nullptr;
if (!sdMounted()) {
return;
}
if (isFunctionActive(FUNCTION_LOGS) && logDelay > 0) {
tmr10ms_t tmr10ms = get_tmr10ms();
if (lastLogTime == 0 || (tmr10ms_t)(tmr10ms - lastLogTime) >= (tmr10ms_t)logDelay*10) {