diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-26 14:26:35 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-06-26 14:26:35 +0200 |
commit | 7546b99a24a33ff160b29b5be31a9e0d39bbce1a (patch) | |
tree | ed049b54277e661b46af78a5ef5813ca2da6bd37 /src/modules/mavlink | |
parent | f9db1723e3899589c10f4f8847c3db1029f999cb (diff) | |
download | px4-firmware-7546b99a24a33ff160b29b5be31a9e0d39bbce1a.tar.gz px4-firmware-7546b99a24a33ff160b29b5be31a9e0d39bbce1a.tar.bz2 px4-firmware-7546b99a24a33ff160b29b5be31a9e0d39bbce1a.zip |
mavlink-ftp: Add extra padding because the ringbuffer implementation relies on its use
Diffstat (limited to 'src/modules/mavlink')
-rw-r--r-- | src/modules/mavlink/mavlink_main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/mavlink/mavlink_main.cpp b/src/modules/mavlink/mavlink_main.cpp index 647519ea5..e9cce175d 100644 --- a/src/modules/mavlink/mavlink_main.cpp +++ b/src/modules/mavlink/mavlink_main.cpp @@ -1903,8 +1903,11 @@ Mavlink::task_main(int argc, char *argv[]) /* if we are passing on mavlink messages, we need to prepare a buffer for this instance */ if (_passing_on || _ftp_on) { - /* initialize message buffer if multiplexing is on */ - if (OK != message_buffer_init(2 * MAVLINK_MAX_PACKET_LEN)) { + /* initialize message buffer if multiplexing is on or its needed for FTP. + * make space for two messages plus off-by-one space as we use the empty element + * marker ring buffer approach. + */ + if (OK != message_buffer_init(2 * MAVLINK_MAX_PACKET_LEN + 2)) { errx(1, "can't allocate message buffer, exiting"); } |