mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-06 20:51:36 +08:00
Snapdragon RC pwm: Only reserve one MAVLink buffer
This commit is contained in:
@@ -35,6 +35,7 @@ px4_add_module(
|
|||||||
MAIN snapdragon_rc_pwm
|
MAIN snapdragon_rc_pwm
|
||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
-Os
|
-Os
|
||||||
|
-DMAVLINK_COMM_NUM_BUFFERS=1
|
||||||
SRCS
|
SRCS
|
||||||
snapdragon_rc_pwm.cpp
|
snapdragon_rc_pwm.cpp
|
||||||
DEPENDS
|
DEPENDS
|
||||||
|
|||||||
@@ -52,6 +52,7 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <uORB/topics/input_rc.h>
|
#include <uORB/topics/input_rc.h>
|
||||||
#include <uORB/topics/actuator_controls.h>
|
#include <uORB/topics/actuator_controls.h>
|
||||||
|
|
||||||
#include <v1.0/mavlink_types.h>
|
#include <v1.0/mavlink_types.h>
|
||||||
#include <v1.0/common/mavlink.h>
|
#include <v1.0/common/mavlink.h>
|
||||||
|
|
||||||
@@ -155,7 +156,7 @@ void task_main(int argc, char *argv[])
|
|||||||
mavlink_message_t msg;
|
mavlink_message_t msg;
|
||||||
|
|
||||||
for (int i = 0; i < len; ++i) {
|
for (int i = 0; i < len; ++i) {
|
||||||
if (mavlink_parse_char(MAVLINK_COMM_1, serial_buf[i], &msg, &serial_status)) {
|
if (mavlink_parse_char(MAVLINK_COMM_0, serial_buf[i], &msg, &serial_status)) {
|
||||||
// have a message, handle it
|
// have a message, handle it
|
||||||
handle_message(&msg);
|
handle_message(&msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user