diff --git a/libraries/AP_Logger/AP_Logger_File.cpp b/libraries/AP_Logger/AP_Logger_File.cpp index bdec58e0cb..a03f6c320f 100644 --- a/libraries/AP_Logger/AP_Logger_File.cpp +++ b/libraries/AP_Logger/AP_Logger_File.cpp @@ -815,7 +815,7 @@ uint16_t AP_Logger_File::get_num_logs() void AP_Logger_File::stop_logging(void) { // best-case effort to avoid annoying the IO thread - const bool have_sem = write_fd_semaphore.take(1); + const bool have_sem = write_fd_semaphore.take(hal.util->get_soft_armed()?1:20); if (_write_fd != -1) { int fd = _write_fd; _write_fd = -1; @@ -823,8 +823,6 @@ void AP_Logger_File::stop_logging(void) } if (have_sem) { write_fd_semaphore.give(); - } else { - AP::internalerror().error(AP_InternalError::error_t::logger_stopping_without_sem); } }