logger: do not write param changes if _should_stop_file_log is set

_should_stop_file_log is set after disarming: logging continues for 1s
to measure the CPU usage.
During that time, other modules might change params (such as ekf), and
we don't need to have these the log. However currently all modules do
not notify the system when setting params after disarming.
Meaning this patch is not strictly needed, it's more a preventive
measure.
This commit is contained in:
Beat Küng
2017-12-07 11:55:51 +00:00
committed by Lorenz Meier
parent b5be990109
commit 1dbeec6a19
+4 -3
View File
@@ -1005,9 +1005,10 @@ void Logger::run()
bool data_written = false;
/* Check if parameters have changed */
// this needs to change to a timestamped record to record a history of parameter changes
if (parameter_update_sub.update()) {
write_changed_parameters();
if (!_should_stop_file_log) { // do not record param changes after disarming
if (parameter_update_sub.update()) {
write_changed_parameters();
}
}
/* wait for lock on log buffer */