aboutsummaryrefslogtreecommitdiff
path: root/src/modules/sdlog2/sdlog2.c
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2013-06-17 14:44:45 +0400
committerAnton Babushkin <anton.babushkin@me.com>2013-06-17 14:44:45 +0400
commit22a925adeb2cae7496c31da35cd5f93d2993c01f (patch)
tree62584c904a420e0a4a448db757f41126341c6bd4 /src/modules/sdlog2/sdlog2.c
parent138ce117ab0a9b95f473f34ce8644fa6456b32a6 (diff)
parentbadaa5e4a23561834ff4badbe3a62fbf3d3e02aa (diff)
downloadpx4-firmware-22a925adeb2cae7496c31da35cd5f93d2993c01f.tar.gz
px4-firmware-22a925adeb2cae7496c31da35cd5f93d2993c01f.tar.bz2
px4-firmware-22a925adeb2cae7496c31da35cd5f93d2993c01f.zip
Merge branch 'master' into sdlog2
Diffstat (limited to 'src/modules/sdlog2/sdlog2.c')
-rw-r--r--src/modules/sdlog2/sdlog2.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c
index f67cfad87..178986f61 100644
--- a/src/modules/sdlog2/sdlog2.c
+++ b/src/modules/sdlog2/sdlog2.c
@@ -241,7 +241,7 @@ int sdlog2_main(int argc, char *argv[])
deamon_task = task_spawn("sdlog2",
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT - 30,
- 2048,
+ 3000,
sdlog2_thread_main,
(const char **)argv);
exit(0);
@@ -661,6 +661,7 @@ int sdlog2_thread_main(int argc, char *argv[])
int vicon_pos_sub;
int flow_sub;
int rc_sub;
+ int airspeed_sub;
} subs;
/* log message buffer: header + body */
@@ -680,6 +681,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct log_STAT_s log_STAT;
struct log_RC_s log_RC;
struct log_OUT0_s log_OUT0;
+ struct log_AIRS_s log_AIRS;
struct log_ARSP_s log_ARSP;
} body;
} log_msg = {
@@ -784,6 +786,12 @@ int sdlog2_thread_main(int argc, char *argv[])
fds[fdsc_count].events = POLLIN;
fdsc_count++;
+ /* --- AIRSPEED --- */
+ subs.airspeed_sub = orb_subscribe(ORB_ID(airspeed));
+ fds[fdsc_count].fd = subs.airspeed_sub;
+ fds[fdsc_count].events = POLLIN;
+ fdsc_count++;
+
/* WARNING: If you get the error message below,
* then the number of registered messages (fdsc)
* differs from the number of messages in the above list.
@@ -1070,6 +1078,15 @@ int sdlog2_thread_main(int argc, char *argv[])
LOGBUFFER_WRITE_AND_COUNT(RC);
}
+ /* --- AIRSPEED --- */
+ if (fds[ifds++].revents & POLLIN) {
+ orb_copy(ORB_ID(airspeed), subs.airspeed_sub, &buf.airspeed);
+ log_msg.msg_type = LOG_AIRS_MSG;
+ log_msg.body.log_AIRS.indicated_airspeed = buf.airspeed.indicated_airspeed_m_s;
+ log_msg.body.log_AIRS.true_airspeed = buf.airspeed.true_airspeed_m_s;
+ LOGBUFFER_WRITE_AND_COUNT(AIRS);
+ }
+
/* signal the other thread new data, but not yet unlock */
if (logbuffer_count(&lb) > MIN_BYTES_TO_WRITE) {
#ifdef SDLOG2_DEBUG