mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 20:43:34 +08:00
Merge branch 'beta' into offboard2
This commit is contained in:
@@ -48,5 +48,5 @@ set MIXER FMU_quad_x
|
||||
set PWM_OUTPUTS 1234
|
||||
set PWM_RATE 400
|
||||
set PWM_DISARMED 900
|
||||
set PWM_MIN 1000
|
||||
set PWM_MIN 1100
|
||||
set PWM_MAX 2000
|
||||
|
||||
@@ -8,7 +8,7 @@ then
|
||||
if hw_ver compare PX4FMU_V1
|
||||
then
|
||||
echo "Start sdlog2 at 50Hz"
|
||||
sdlog2 start -r 50 -a -b 16 -t
|
||||
sdlog2 start -r 50 -a -b 8 -t
|
||||
else
|
||||
echo "Start sdlog2 at 200Hz"
|
||||
sdlog2 start -r 200 -a -b 16 -t
|
||||
|
||||
@@ -474,7 +474,7 @@ then
|
||||
set MAV_TYPE 2
|
||||
|
||||
# Use mixer to detect vehicle type
|
||||
if [ $MIXER == FMU_hex_x -o $MIXER == FMU_hex_+ ]
|
||||
if [ $MIXER == FMU_hexa_x -o $MIXER == FMU_hexa_+ ]
|
||||
then
|
||||
set MAV_TYPE 13
|
||||
fi
|
||||
|
||||
@@ -52,7 +52,8 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen)
|
||||
/* open the mixer definition file */
|
||||
fp = fopen(fname, "r");
|
||||
if (fp == NULL) {
|
||||
return 1;
|
||||
warnx("file not found");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* read valid lines from the file into a buffer */
|
||||
@@ -88,7 +89,8 @@ int load_mixer_file(const char *fname, char *buf, unsigned maxlen)
|
||||
|
||||
/* if the line is too long to fit in the buffer, bail */
|
||||
if ((strlen(line) + strlen(buf) + 1) >= maxlen) {
|
||||
return 1;
|
||||
warnx("line too long");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* add the line to the buffer */
|
||||
|
||||
@@ -102,7 +102,8 @@ load(const char *devname, const char *fname)
|
||||
if (ioctl(dev, MIXERIOCRESET, 0))
|
||||
err(1, "can't reset mixers on %s", devname);
|
||||
|
||||
load_mixer_file(fname, &buf[0], sizeof(buf));
|
||||
if (load_mixer_file(fname, &buf[0], sizeof(buf)) < 0)
|
||||
err(1, "can't load mixer: %s", fname);
|
||||
|
||||
/* XXX pass the buffer to the device */
|
||||
int ret = ioctl(dev, MIXERIOCLOADBUF, (unsigned long)buf);
|
||||
|
||||
Reference in New Issue
Block a user