mavlink: enable 6 instead of 4 instance

This commit is contained in:
Julian Oes
2021-02-17 13:54:34 -05:00
committed by Daniel Agar
parent a16939f47e
commit 2a0ddf9f44
6 changed files with 20 additions and 9 deletions
+9 -4
View File
@@ -102,14 +102,19 @@ private:
static MavlinkCommandSender *_instance;
static px4_sem_t _lock;
// There are MAVLINK_COMM_0 to MAVLINK_COMM_3, so it should be 4.
static const unsigned MAX_MAVLINK_CHANNEL = 4;
struct command_item_s {
mavlink_command_long_t command = {};
hrt_abstime timestamp_us = 0;
hrt_abstime last_time_sent_us = 0;
int8_t num_sent_per_channel[MAX_MAVLINK_CHANNEL] = {-1, -1, -1, -1}; // -1: channel did not request this command to be sent, -2: channel got an ack for this command
// -1: channel did not request this command to be sent, -2: channel got an ack for this command
#if MAVLINK_COMM_NUM_BUFFERS == 4
int8_t num_sent_per_channel[MAVLINK_COMM_NUM_BUFFERS] = {-1, -1, -1, -1};
#elif MAVLINK_COMM_NUM_BUFFERS == 6
int8_t num_sent_per_channel[MAVLINK_COMM_NUM_BUFFERS] = {-1, -1, -1, -1, -1, -1};
#else
#error Unknown number of MAVLINK_COMM_NUM_BUFFERS
#endif
};
TimestampedList<command_item_s> _commands{3};