From 1dbeec6a194a32d56f29d63a6bcf11a4ab1e46b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 7 Dec 2017 11:05:42 +0100 Subject: [PATCH] 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. --- src/modules/logger/logger.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index 2014dabbbd..e4b066651c 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -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 */