MAVLink: Limit use to 3 instances, which is what is realistically being used.

This commit is contained in:
Lorenz Meier
2015-08-10 17:07:11 +02:00
parent 138daf3b36
commit 05d752ae34
2 changed files with 8 additions and 2 deletions
+6
View File
@@ -1789,6 +1789,12 @@ Mavlink::start(int argc, char *argv[])
// before returning to the shell
int ic = Mavlink::instance_count();
if (ic == MAVLINK_COMM_NUM_BUFFERS) {
warnx("Maximum MAVLink instance count of %d reached.",
(int)MAVLINK_COMM_NUM_BUFFERS);
return 1;
}
// Instantiate thread
char buf[24];
sprintf(buf, "mavlink_if%d", ic);
+2 -2
View File
@@ -53,6 +53,6 @@ MAXOPTIMIZATION = -Os
MODULE_STACKSIZE = 1200
EXTRACXXFLAGS = -Weffc++ -Wno-attributes -Wno-packed
EXTRACXXFLAGS = -Weffc++ -Wno-attributes -Wno-packed -DMAVLINK_COMM_NUM_BUFFERS=3
EXTRACFLAGS = -Wno-packed
EXTRACFLAGS = -Wno-packed -DMAVLINK_COMM_NUM_BUFFERS=3