Skip to content
Snippets Groups Projects
Commit 659ac8fa authored by Beat Küng's avatar Beat Küng Committed by Lorenz Meier
Browse files

refactor logger: use static fields & move them to source file

avoids multiple declarations of...
parent 43d734ef
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,10 @@
using namespace px4::logger;
static Logger *logger_ptr = nullptr;
static int logger_task = -1;
static pthread_t writer_thread;
int logger_main(int argc, char *argv[])
{
// logger currently assumes little endian
......@@ -464,7 +468,7 @@ void Logger::run()
return;
}
int ret = _writer.thread_start(_writer_thread);
int ret = _writer.thread_start(writer_thread);
if (ret) {
PX4_ERR("logger: failed to create writer thread (%i)", ret);
......@@ -616,7 +620,7 @@ void Logger::run()
_writer.notify();
// wait for thread to complete
ret = pthread_join(_writer_thread, NULL);
ret = pthread_join(writer_thread, NULL);
if (ret) {
PX4_WARN("join failed: %d", ret);
......
......@@ -203,11 +203,8 @@ private:
param_t _log_utc_offset;
orb_advert_t _mavlink_log_pub = nullptr;
uint16_t _next_topic_id; ///< id of next subscribed topic
};
Logger *logger_ptr = nullptr;
int logger_task = -1;
pthread_t _writer_thread;
};
}
}
} //namespace logger
} //namespace px4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment