mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
Merge branch 'master' of github.com:PX4/Firmware
This commit is contained in:
@@ -21,6 +21,7 @@ ROMFS_FSSPEC := $(SRCROOT)/scripts/rcS~init.d/rcS \
|
||||
$(SRCROOT)/scripts/rc.standalone~init.d/rc.standalone \
|
||||
$(SRCROOT)/scripts/rc.PX4IO~init.d/rc.PX4IO \
|
||||
$(SRCROOT)/scripts/rc.PX4IOAR~init.d/rc.PX4IOAR \
|
||||
$(SRCROOT)/scripts/rc.FMU_quad_x~init.d/rc.FMU_quad_x \
|
||||
$(SRCROOT)/mixers/FMU_pass.mix~mixers/FMU_pass.mix \
|
||||
$(SRCROOT)/mixers/FMU_delta.mix~mixers/FMU_delta.mix \
|
||||
$(SRCROOT)/mixers/FMU_AERT.mix~mixers/FMU_AERT.mix \
|
||||
|
||||
@@ -172,10 +172,16 @@ class uploader(object):
|
||||
self.__send(uploader.CHIP_ERASE
|
||||
+ uploader.EOC)
|
||||
# erase is very slow, give it 10s
|
||||
old_timeout = self.port.timeout
|
||||
self.port.timeout = 10
|
||||
self.__getSync()
|
||||
self.port.timeout = old_timeout
|
||||
deadline = time.time() + 10
|
||||
while time.time() < deadline:
|
||||
try:
|
||||
self.__getSync()
|
||||
return
|
||||
except RuntimeError as ex:
|
||||
# we timed out, that's OK
|
||||
continue
|
||||
|
||||
raise RuntimeError("timed out waiting for erase")
|
||||
|
||||
# send a PROG_MULTI command to write a collection of bytes
|
||||
def __program_multi(self, data):
|
||||
|
||||
@@ -150,15 +150,15 @@ void attitude_blackmagic_init(void)
|
||||
0.0007f , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0.0007f , 0 , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0.0007f , 0 , 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0.01f, 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0.01f, 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0.01f, 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0.015f, 0 , 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0.015f, 0 , 0 , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0.015f, 0 , 0 , 0,
|
||||
0.0000f , +0.00002f, 0 , 0 , 0, 0, 0, 0 , 0,
|
||||
-0.00002f, 0 , 0 , 0 , 0, 0, 0, 0, 0,
|
||||
0, 0 , 0 , 0, 0, 0, 0, 0, 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0.4f , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.4f , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.4f
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0.7f , 0 , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.7f , 0,
|
||||
0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0.7f
|
||||
};
|
||||
//offset update only correct if not upside down.
|
||||
|
||||
|
||||
@@ -533,12 +533,10 @@ Sensors::accel_init()
|
||||
warnx("using BMA180");
|
||||
} else {
|
||||
/* set the accel internal sampling rate up to at leat 500Hz */
|
||||
if (OK != ioctl(fd, ACCELIOCSSAMPLERATE, 500))
|
||||
warn("WARNING: failed to set minimum 500Hz sample rate for accel");
|
||||
ioctl(fd, ACCELIOCSSAMPLERATE, 500);
|
||||
|
||||
/* set the driver to poll at 500Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 500))
|
||||
warn("WARNING: failed to set 500Hz poll rate for accel");
|
||||
ioctl(fd, SENSORIOCSPOLLRATE, 500);
|
||||
|
||||
warnx("using system accel");
|
||||
close(fd);
|
||||
@@ -568,12 +566,10 @@ Sensors::gyro_init()
|
||||
warn("using L3GD20");
|
||||
} else {
|
||||
/* set the gyro internal sampling rate up to at leat 500Hz */
|
||||
if (OK != ioctl(fd, GYROIOCSSAMPLERATE, 500))
|
||||
warn("WARNING: failed to set minimum 500Hz sample rate for gyro");
|
||||
ioctl(fd, GYROIOCSSAMPLERATE, 500);
|
||||
|
||||
/* set the driver to poll at 500Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 500))
|
||||
warn("WARNING: failed to set 500Hz poll rate for gyro");
|
||||
ioctl(fd, SENSORIOCSPOLLRATE, 500);
|
||||
|
||||
warnx("using system gyro");
|
||||
close(fd);
|
||||
@@ -592,12 +588,10 @@ Sensors::mag_init()
|
||||
}
|
||||
|
||||
/* set the mag internal poll rate to at least 150Hz */
|
||||
if (OK != ioctl(fd, MAGIOCSSAMPLERATE, 150))
|
||||
warn("WARNING: failed to set minimum 150Hz sample rate for mag");
|
||||
ioctl(fd, MAGIOCSSAMPLERATE, 150);
|
||||
|
||||
/* set the driver to poll at 150Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 150))
|
||||
warn("WARNING: failed to set 150Hz poll rate for mag");
|
||||
ioctl(fd, SENSORIOCSPOLLRATE, 150);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
@@ -614,8 +608,7 @@ Sensors::baro_init()
|
||||
}
|
||||
|
||||
/* set the driver to poll at 150Hz */
|
||||
if (OK != ioctl(fd, SENSORIOCSPOLLRATE, 150))
|
||||
warn("WARNING: failed to set 150Hz poll rate for baro");
|
||||
ioctl(fd, SENSORIOCSPOLLRATE, 150);
|
||||
|
||||
close(fd);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ int boardinfo_main(int argc, char *argv[])
|
||||
int ret = carrier_get_board_info(&info);
|
||||
|
||||
if (ret != sizeof(info)) {
|
||||
fprintf(stderr, "[boardinfo] ERROR loading board info from EEPROM (errno #%d), aborting\n", -ret);
|
||||
fprintf(stderr, "[boardinfo] no EEPROM for board %d\n", test_boardid);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,9 +87,7 @@ gpietsch@comcast.net
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifndef GETOPT_H
|
||||
#include "getopt_long.h"
|
||||
#endif
|
||||
|
||||
/* macros */
|
||||
|
||||
@@ -143,8 +141,8 @@ is_option (char *argv_element, int only)
|
||||
|
||||
/* getopt_internal: the function that does all the dirty work */
|
||||
static int
|
||||
getopt_internal (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind, int only)
|
||||
getopt_internal (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind, int only)
|
||||
{
|
||||
GETOPT_ORDERING_T ordering = PERMUTE;
|
||||
static size_t optwhere = 0;
|
||||
@@ -178,7 +176,7 @@ getopt_internal (int argc, char **argv, char *shortopts,
|
||||
shortopts++;
|
||||
}
|
||||
else
|
||||
ordering = (getenv ("POSIXLY_CORRECT") != NULL) ? REQUIRE_ORDER : PERMUTE;
|
||||
ordering = /*(getenv ("POSIXLY_CORRECT") != NULL) ? REQUIRE_ORDER :*/ PERMUTE;
|
||||
|
||||
/*
|
||||
* based on ordering, find our next option, if we're at the beginning of
|
||||
@@ -381,22 +379,24 @@ getopt_internal (int argc, char **argv, char *shortopts,
|
||||
return optopt;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int
|
||||
getopt (int argc, char **argv, char *optstring)
|
||||
{
|
||||
return getopt_internal (argc, argv, optstring, NULL, NULL, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
getopt_long (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
getopt_long (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
{
|
||||
return getopt_internal (argc, argv, shortopts, longopts, longind, 0);
|
||||
}
|
||||
|
||||
int
|
||||
getopt_long_only (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
getopt_long_only (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind)
|
||||
{
|
||||
return getopt_internal (argc, argv, shortopts, longopts, longind, 1);
|
||||
}
|
||||
|
||||
@@ -121,11 +121,13 @@ extern "C"
|
||||
extern int optopt;
|
||||
|
||||
/* function prototypes */
|
||||
#if 0
|
||||
int getopt (int argc, char **argv, char *optstring);
|
||||
int getopt_long (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind);
|
||||
int getopt_long_only (int argc, char **argv, char *shortopts,
|
||||
GETOPT_LONG_OPTION_T * longopts, int *longind);
|
||||
#endif
|
||||
int getopt_long (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind);
|
||||
int getopt_long_only (int argc, char **argv, const char *shortopts,
|
||||
const GETOPT_LONG_OPTION_T * longopts, int *longind);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -176,7 +176,8 @@ int carrier_get_board_info(struct carrier_board_info_s *info)
|
||||
int ret;
|
||||
int fd = open("/dev/eeprom", O_RDONLY | O_NONBLOCK);
|
||||
|
||||
if (fd < 0) fprintf(stderr, "[boardinfo carrier] ERROR opening carrier eeprom\n");
|
||||
if (fd < 0)
|
||||
return -1; /* no board */
|
||||
|
||||
ret = read(fd, info, sizeof(struct carrier_board_info_s));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user