From 115751833b72722cfca0d3324f638d1e7080efb9 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 11 May 2020 12:45:23 +1000 Subject: [PATCH] AP_Logger: process pending rotate on arming If the user arms the vehicle during the logging-persist-timeout we should rotate the log immediately. --- libraries/AP_Logger/AP_Logger_File.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; }