mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-23 00:04:02 -04:00
AP_Logger: ensure log directory exists before opening log
This will help with starting logs when inserting a fresh SD card which doesn't have the ardupilot log directory on it
This commit is contained in:
parent
66f8359c6b
commit
0c5d31f40f
@ -82,9 +82,6 @@ void AP_Logger_File::Init()
|
||||
{
|
||||
AP_Logger_Backend::Init();
|
||||
|
||||
// create the log directory if need be
|
||||
ensure_log_directory_exists();
|
||||
|
||||
// determine and limit file backend buffersize
|
||||
uint32_t bufsize = _front._params.file_bufsize;
|
||||
if (bufsize > 64) {
|
||||
@ -837,6 +834,9 @@ void AP_Logger_File::start_new_log(void)
|
||||
_need_rtc_update = !AP::rtc().get_utc_usec(utc_usec);
|
||||
#endif
|
||||
|
||||
// create the log directory if need be
|
||||
ensure_log_directory_exists();
|
||||
|
||||
EXPECT_DELAY_MS(3000);
|
||||
_write_fd = AP::FS().open(_write_filename, O_WRONLY|O_CREAT|O_TRUNC);
|
||||
_cached_oldest_log = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user