diff --git a/ROMFS/Makefile b/ROMFS/Makefile index cc419a6394..39d74d6825 100644 --- a/ROMFS/Makefile +++ b/ROMFS/Makefile @@ -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 \ diff --git a/ROMFS/scripts/rc.PX4FMU_quad_x b/ROMFS/scripts/rc.FMU_quad_x similarity index 100% rename from ROMFS/scripts/rc.PX4FMU_quad_x rename to ROMFS/scripts/rc.FMU_quad_x diff --git a/Tools/px_uploader.py b/Tools/px_uploader.py index 1a0d7bd45b..dfb53980a9 100755 --- a/Tools/px_uploader.py +++ b/Tools/px_uploader.py @@ -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): diff --git a/apps/px4/attitude_estimator_bm/attitude_bm.c b/apps/px4/attitude_estimator_bm/attitude_bm.c index 8face5aea5..6921db3757 100644 --- a/apps/px4/attitude_estimator_bm/attitude_bm.c +++ b/apps/px4/attitude_estimator_bm/attitude_bm.c @@ -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. diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp index 963c54b8e5..d388a6d5a1 100644 --- a/apps/sensors/sensors.cpp +++ b/apps/sensors/sensors.cpp @@ -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); } diff --git a/apps/systemcmds/boardinfo/boardinfo.c b/apps/systemcmds/boardinfo/boardinfo.c index 0ae0ee8d2b..bce8c27e7c 100644 --- a/apps/systemcmds/boardinfo/boardinfo.c +++ b/apps/systemcmds/boardinfo/boardinfo.c @@ -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); } diff --git a/apps/systemlib/getopt_long.c b/apps/systemlib/getopt_long.c index 662d73ff12..27c38635f7 100644 --- a/apps/systemlib/getopt_long.c +++ b/apps/systemlib/getopt_long.c @@ -87,9 +87,7 @@ gpietsch@comcast.net #include #include #include -#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); } diff --git a/apps/systemlib/getopt_long.h b/apps/systemlib/getopt_long.h index f372fedaa3..3e51550a60 100644 --- a/apps/systemlib/getopt_long.h +++ b/apps/systemlib/getopt_long.h @@ -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 }; diff --git a/apps/systemlib/systemlib.c b/apps/systemlib/systemlib.c index bed5b1a101..4c7aae83e2 100644 --- a/apps/systemlib/systemlib.c +++ b/apps/systemlib/systemlib.c @@ -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));