diff --git a/libraries/AP_Logger/AP_Logger_File.cpp b/libraries/AP_Logger/AP_Logger_File.cpp index 98a7703881..f3c32f89dd 100644 --- a/libraries/AP_Logger/AP_Logger_File.cpp +++ b/libraries/AP_Logger/AP_Logger_File.cpp @@ -767,6 +767,10 @@ void AP_Logger_File::stop_logging(void) void AP_Logger_File::PrepForArming() { + if (_rotate_pending) { + _rotate_pending = false; + stop_logging(); + } if (logging_started()) { return; }