From ccd90e19a1ea87881cc09748348adfaec2347463 Mon Sep 17 00:00:00 2001 From: night-ghost Date: Thu, 26 Apr 2018 13:36:29 +0500 Subject: [PATCH] fixed DataFlash_File_sd.cpp in case of SD error --- libraries/DataFlash/DataFlash_File_sd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/DataFlash/DataFlash_File_sd.cpp b/libraries/DataFlash/DataFlash_File_sd.cpp index 3062bb1824..4c0f0c5a5f 100644 --- a/libraries/DataFlash/DataFlash_File_sd.cpp +++ b/libraries/DataFlash/DataFlash_File_sd.cpp @@ -151,7 +151,8 @@ void DataFlash_File::periodic_1Hz(const uint32_t now) // likely to cause a crash. // _write_fd.close(); _write_fd.sync(); - printf("\nLoging stopped\n"); + printf("\nLoging aborted\n"); + _open_error = true; _initialised = false; } } @@ -820,6 +821,7 @@ uint16_t DataFlash_File::start_new_log(void) log_num = 1; if(was_ovf) { _initialised = false; // no space + _open_error = true; // don't try any more printf("\nLoging stopped\n"); return 0xFFFF; }