diff --git a/libraries/DataFlash/DataFlash_File.cpp b/libraries/DataFlash/DataFlash_File.cpp index 9576510564..f7e9197313 100644 --- a/libraries/DataFlash/DataFlash_File.cpp +++ b/libraries/DataFlash/DataFlash_File.cpp @@ -186,7 +186,12 @@ bool DataFlash_File::log_exists(const uint16_t lognum) const void DataFlash_File::periodic_1Hz(const uint32_t now) { if (!io_thread_alive()) { - GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "No IO Thread Heartbeat"); + if (io_thread_warning_decimation_counter == 0) { + GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "No IO Thread Heartbeat"); + } + if (io_thread_warning_decimation_counter++ > 57) { + io_thread_warning_decimation_counter = 0; + } // If you try to close the file here then it will almost // certainly block. Since this is the main thread, this is // likely to cause a crash. diff --git a/libraries/DataFlash/DataFlash_File.h b/libraries/DataFlash/DataFlash_File.h index 56025499f7..cb8f8ec33d 100644 --- a/libraries/DataFlash/DataFlash_File.h +++ b/libraries/DataFlash/DataFlash_File.h @@ -85,6 +85,7 @@ private: uint32_t _io_timer_heartbeat; bool io_thread_alive() const; + uint8_t io_thread_warning_decimation_counter; uint16_t _cached_oldest_log;