From 14c0fae175452da6e28ffc20b265de621a2430ba Mon Sep 17 00:00:00 2001 From: Anton Babushkin Date: Tue, 14 Jan 2014 15:47:21 +0100 Subject: sdlog2: fixed state logging if navigator not running --- src/modules/sdlog2/sdlog2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index 3873dc96e..7083ce5a2 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -977,7 +977,9 @@ int sdlog2_thread_main(int argc, char *argv[]) if (fds[ifds++].revents & POLLIN) { /* don't orb_copy, it's already done few lines above */ /* copy control mode here to construct STAT message */ - orb_copy(ORB_ID(vehicle_control_mode), subs.control_mode_sub, &buf.control_mode); + if (fds[ifds].revents & POLLIN) { + orb_copy(ORB_ID(vehicle_control_mode), subs.control_mode_sub, &buf.control_mode); + } log_msg.msg_type = LOG_STAT_MSG; log_msg.body.log_STAT.main_state = (uint8_t) buf.control_mode.main_state; log_msg.body.log_STAT.navigation_state = (uint8_t) buf.control_mode.nav_state; -- cgit v1.2.3