aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2012-09-10 20:52:59 +0200
committerLorenz Meier <lm@inf.ethz.ch>2012-09-10 20:52:59 +0200
commit0019f65b10dfdaa962283c916798df7b209ba9fc (patch)
tree6827ba9d88a9b8f7a26b5b2b321fa719c73cfaaa /apps
parent246f8fd3bdd6ef9391b444f6b78f5a2191a968a1 (diff)
parent4b293a19e6a2862fe52fd49f35ed27efeeb88eaa (diff)
downloadpx4-firmware-0019f65b10dfdaa962283c916798df7b209ba9fc.tar.gz
px4-firmware-0019f65b10dfdaa962283c916798df7b209ba9fc.tar.bz2
px4-firmware-0019f65b10dfdaa962283c916798df7b209ba9fc.zip
Merge branch 'master' of github.com:PX4/Firmware
Diffstat (limited to 'apps')
-rw-r--r--apps/px4/attitude_estimator_bm/attitude_bm.c12
-rw-r--r--apps/sensors/sensors.cpp21
-rw-r--r--apps/systemcmds/boardinfo/boardinfo.c2
-rw-r--r--apps/systemlib/getopt_long.c18
-rw-r--r--apps/systemlib/getopt_long.h10
-rw-r--r--apps/systemlib/systemlib.c3
6 files changed, 31 insertions, 35 deletions
diff --git a/apps/px4/attitude_estimator_bm/attitude_bm.c b/apps/px4/attitude_estimator_bm/attitude_bm.c
index 8face5aea..6921db375 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 963c54b8e..d388a6d5a 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 0ae0ee8d2..bce8c27e7 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 662d73ff1..27c38635f 100644
--- a/apps/systemlib/getopt_long.c
+++ b/apps/systemlib/getopt_long.c
@@ -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);
}
diff --git a/apps/systemlib/getopt_long.h b/apps/systemlib/getopt_long.h
index f372fedaa..3e51550a6 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 bed5b1a10..4c7aae83e 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));