mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 07:43:33 +08:00
MAVLink: Limit use to 3 instances, which is what is realistically being used.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user