From b5ae588341f07c5310cc25e2549cc4cb1e917de6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 20 Apr 2013 10:41:04 +1000 Subject: [PATCH] DataFlash_File: fixed creation of 0.log --- libraries/DataFlash/DataFlash_File.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/DataFlash/DataFlash_File.cpp b/libraries/DataFlash/DataFlash_File.cpp index f6585531dd..df5ac027c1 100644 --- a/libraries/DataFlash/DataFlash_File.cpp +++ b/libraries/DataFlash/DataFlash_File.cpp @@ -264,7 +264,7 @@ uint16_t DataFlash_File::start_new_log(void) uint16_t log_num = find_last_log(); // re-use empty logs if possible - if (_get_log_size(log_num) > 0) { + if (_get_log_size(log_num) > 0 || log_num == 0) { log_num++; } if (log_num > MAX_LOG_FILES) {