|
@@ -330,6 +330,28 @@ int main (void)
|
|
|
System.status = STATUS_DISK_ERROR;
|
|
|
continue;
|
|
|
}
|
|
|
+
|
|
|
+ res = f_mkdir(DIR_PATH_GPX);
|
|
|
+ if (res != FR_OK && res != FR_EXIST) {
|
|
|
+ xprintf(PSTR("FS dir error %u\r\n"), res);
|
|
|
+ System.status = STATUS_DISK_ERROR;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ res = f_mkdir(DIR_PATH_SYSLOG);
|
|
|
+ if (res != FR_OK && res != FR_EXIST) {
|
|
|
+ xprintf(PSTR("FS dir error %u\r\n"), res);
|
|
|
+ System.status = STATUS_DISK_ERROR;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ res = f_mkdir(DIR_PATH_NMEA);
|
|
|
+ if (res != FR_OK && res != FR_EXIST) {
|
|
|
+ xprintf(PSTR("FS dir error %u\r\n"), res);
|
|
|
+ System.status = STATUS_DISK_ERROR;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
System.status = STATUS_NO_GPS;
|
|
|
xputs(PSTR("FS Ok\r\n"));
|
|
|
display_state(DISPLAY_STATE_CARD_OK);
|
|
@@ -410,7 +432,7 @@ int main (void)
|
|
|
}
|
|
|
ptr++;
|
|
|
}
|
|
|
- xsprintf(Line, PSTR("%s-NMEA.LOG"), time);
|
|
|
+ xsprintf(Line, PSTR("%s/%s-NMEA.LOG"), DIR_PATH_NMEA, time);
|
|
|
xprintf(__open_msg, Line);
|
|
|
if (f_open(&gps_log, Line, FA_WRITE | FA_OPEN_ALWAYS) /* Open log file */
|
|
|
|| f_lseek(&gps_log, f_size(&gps_log)) /* Append mode */
|
|
@@ -421,7 +443,7 @@ int main (void)
|
|
|
}
|
|
|
wdt_reset();
|
|
|
|
|
|
- xsprintf(Line, PSTR("%s.GPX"), time);
|
|
|
+ xsprintf(Line, PSTR("%s/%s.GPX"), DIR_PATH_GPX, time);
|
|
|
xprintf(__open_msg, Line);
|
|
|
if (f_open(&gpx_file, Line, FA_WRITE | FA_OPEN_ALWAYS) /* Open log file */
|
|
|
|| f_lseek(&gpx_file, f_size(&gpx_file)) /* Append mode */
|
|
@@ -433,7 +455,7 @@ int main (void)
|
|
|
}
|
|
|
wdt_reset();
|
|
|
|
|
|
- xsprintf(Line, PSTR("%s-SYSTEM.LOG"), time);
|
|
|
+ xsprintf(Line, PSTR("%s/%s-SYSTEM.LOG"), DIR_PATH_SYSLOG, time);
|
|
|
xprintf(__open_msg, Line);
|
|
|
if (f_open(&system_log, Line, FA_WRITE | FA_OPEN_ALWAYS) /* Open log file */
|
|
|
|| f_lseek(&system_log, f_size(&system_log)) /* Append mode */
|