DataFlash_File: fixed creation of 0.log

This commit is contained in:
Andrew Tridgell 2013-04-20 10:41:04 +10:00
parent 93d075404c
commit b5ae588341
1 changed files with 1 additions and 1 deletions

View File

@ -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) {