Commit Graph

72 Commits

Author SHA1 Message Date
Julien Lecoeur abcb920df4 Fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7.1.0
BMP280: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

gnss: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

fmu: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

timer.c: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

px4cannode_led: fix -Werror=implicit-fallthrough on arm-none-eabi-gcc 7

Fix -Werror=implicit-fallthrough on gcc7
2017-07-18 08:24:37 +02:00
Fredmcc 96cffd4077 Fixed some formatting 2017-06-04 04:43:07 +08:00
Fredmcc 4ffbaed500 Fixed GPS Date on frsky SPort 2017-06-04 04:43:07 +08:00
Fredmcc 90a05a0f55 Fixed SPort heading scale and sourced from vehicle_local_pos 2017-06-04 04:43:07 +08:00
Fredmcc 5290e6cfe1 Fixed SPort scale for GPS coords and Altitude 2017-06-04 04:43:07 +08:00
David Sidrane 4fe29e5246 Fiexs frsky telemetry stack warning
WARN  [load_mon] frsky_telemetry low on stack! (164 bytes left)

Added 168 bytes = 160 needed + 8 bytes for head room
2017-03-18 10:54:49 +01:00
Lorenz Meier 2ccf0c7bea FrSky: Header fix 2016-12-27 21:00:51 +01:00
Carlo Wood baf89f4398 Clean up of px4_defines.h (remove math.h)
This patch reorders px4_defines.h to make it more readable (I think)
but more importantly, cleans up the #include <math.h>/<cmath>
and [std::]isfinite stuff.

My main goal was to completely get rid of including math.h/cmath,
because that doesn't really belong in a header that is supposed to
define macro's and is included in almost every source file (if not
all).

I'm not sure what it did before ;) (pun intended), but now it does
the following:

PX4_ISFINITE is only used in C++ code (that was already the case,
but hereby is official; for C code just use 'isfinite()') and is
defined to be std::isfinite, except on __PX4_QURT because that uses
the HEXAGON toolset which (erroneously) defines isfinite as macro.

I would have liked to remove PX4_ISFINITE completely from the code
and just use std::isfinite whereever that is needed, but that would
have required changing the libecl submodule, and at the moment I'm
getting tired of changing submodules... so maybe something for the
future.

Also, all includes of <math.h> or <cmath> have been removed except
for __PX4_NUTTX. Like the HEXAGON toolset NuttX currently defines
isfinite as macro for C++. So, we could have solved this in the
same was as __P4_QURT; but since we can fix NuttX ourselves I chose
to add a kludge to px4_defines.h instead that fixes this problem,
until the time that NuttX can be fixed (again postponing changing
a submodule). The kludge still demands including <cmath>, thus.

After removal of the math header file, it needed to be included
in source files that actually need it, of course.

Finally, I had a look at the math macro's (like M_PI, M_PI_F,
M_DEG_TO_RAD etc). These are sometimes (erroneously) defined in
certain math.h header files (like both, hexagon and nuttx).
This is incorrect: neither the C nor the C++ standard defines
math constants (neither as macro nor otherwise). The "problem"
here was that px4_defines.h defined some of the M_*_F float
constants in terms of the M_* double constant, which are
sometimes not defined either thus. So, I cleaned this up by
defining the M_*_F math constants as float literals in px4_defines.h,
except when they are defined in math.h for that platform.
This means that math.h has to be always included when using those
constants, but well; not much difference there as those files
usually also need/use the macro NAN (which *is* a standard macro
defined by math.h).

Finally finally, DEFAULT_PARAM_FILE was removed as it isn't
used anymore.

All in all I think the resulting px4_defines.h is nice, giving me
much less the feeling of a nearly unmaintainable and over time
slowly growing collection of kludges and hacks.
2016-10-28 08:41:30 +02:00
Julian Oes 8ff237c69f Remove size optimization for individual modules
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
2016-09-30 08:11:51 +02:00
Beat Küng 9c73eae941 sensor_combined: replace accel & gyro integral with value, use float for dt
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.

Note that this breaks the replay format for sdlog2 replay
2016-07-07 11:35:50 +02:00
Beat Küng d846ad5dac sensors: move voting into sensors module
- voting is now at a central place instead of duplicated within the
  estimators
  -> this also means that estimators that did not do voting so far,
     now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
  sensors
- allows sensors_combined to be 3 times smaller
  - reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
  the voted result
- this also adds voting to baro
2016-07-07 11:35:50 +02:00
Beat Küng b4ecc5a8d9 sensor_combined cleanup: remove many unneeded fields
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.

Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.

Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.

At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
2016-07-07 11:35:50 +02:00
Mark Whitehorn 0a27d14f6c robustify S.port and D telemetry detection (#4731) 2016-06-09 23:33:57 +02:00
thedevleon 9ff6751eb5 hotfix for frsky dport telemetry (#4409) 2016-05-01 00:41:17 +02:00
Leon b781006e20 Increase sending of navstate and gpsfix to 2 Hz 2016-04-25 07:55:53 +02:00
Leon 5d114d3984 Small improvements and corrections
Added more SPort GPS Sensors

Fix code style

Adding DIY IDs

Moved navstate and gpsfix away from Temp1 and Temp2 to their own IDs

More consistent names

Fix codestyle

Rebase work off master frsky_telemetry driver

Fixed code-style error

forgot something
2016-04-25 07:55:49 +02:00
James Goppert 967e4dd127 Modified cmake to use STACK_MAX and STACK_MAIN 2016-04-14 13:36:36 -04:00
Julian Oes 9859d43fe2 frsky_telemetry: fixed build 2016-04-11 18:01:49 +02:00
Julian Oes 76c66a4e92 frsk_telemetry: astyle 2016-04-11 18:01:47 +02:00
Julian Oes 32c3135788 commander: move battery calculations to systemlib
The commander used to consume the battery_status topic and write the
contents after some calculations into the system state. Instead, the
calculations now happen in library calls in systemlib/battery.

This moves the battery fields out of the vehicle_status message into the
battery_status topic.

This brought quite some changes in all modules that need battery
information. The current state is compiling but untested.
2016-04-11 18:01:47 +02:00
Mark Whitehorn ebacd4c1de add missing check for stop command in idle state 2016-04-11 17:54:39 +02:00
Mark Whitehorn 98a4dd6a4a run astyle 2016-03-01 09:02:14 +01:00
Mark Whitehorn bebe8b0a78 init frsky_state properly 2016-03-01 09:02:14 +01:00
Mark Whitehorn ab596e3711 scan indefinitely for FrSky RX, report state in status 2016-03-01 09:02:14 +01:00
Mark Whitehorn 607053cfbc decrease stack allocation to 1100 2016-03-01 09:02:14 +01:00
Mark Whitehorn 52465d07b9 run astyle 2016-03-01 09:02:14 +01:00
Mark Whitehorn 8186139dad reduce D-type stack usage and static allocations 2016-03-01 09:02:14 +01:00
Mark Whitehorn 6d2927cd7a allocate structs on the heap; exit daemon if no FrSky receiver detected 2016-03-01 09:02:14 +01:00
Mark Whitehorn 95d328f57c remove commented code and change to sensor_baro topic to filter altitude 2016-03-01 09:02:14 +01:00
Mark Whitehorn 6d509835eb clean up uORB code 2016-03-01 09:02:14 +01:00
Mark Whitehorn 0960e1a820 make structs static and decrease stack size, run astyle 2016-03-01 09:02:14 +01:00
Mark Whitehorn 6fa6e72250 add sPort GPS telemetry 2016-03-01 09:02:14 +01:00
Mark Whitehorn 12437f1fc6 increase stack size for frsky telemetry daemon 2016-02-16 10:39:30 -07:00
Mark Whitehorn 42e8fe159f run astyle 2016-02-10 09:23:30 +01:00
Mark Whitehorn cca2807ff0 apply 1st order lowpass filter to baro alt 2016-02-10 09:23:30 +01:00
Mark Whitehorn b25a9a45b5 initial add of Vario sensor. 1st difference of baro_alt... need to add a
LPF in front of the difference
2016-02-10 09:23:30 +01:00
Mark Whitehorn 403810c688 disable console print of incoming telemetry data 2016-02-10 09:21:52 +01:00
Mark Whitehorn e25b26e2a8 fix format 2016-02-10 09:21:52 +01:00
Mark Whitehorn 8116f15d95 enable print of incoming telemetry 2016-02-10 09:21:52 +01:00
Mark Whitehorn 47337eb4a5 add parsing of host frames for D type telemetry 2016-02-10 09:21:52 +01:00
Mark Whitehorn 7b7da618b8 format and disable some warnx output 2016-01-29 09:02:34 +01:00
Mark Whitehorn 81ae5cbd0d check for incoming D type telemetry packet (RX also connected to telemetry port) 2016-01-29 09:02:22 +01:00
Mark Whitehorn d96a17adfb missed some name changes from sPort to frsky 2016-01-24 11:22:18 +01:00
Mark Whitehorn 527fe4b374 remove sPort_telemetry directory 2016-01-24 11:22:18 +01:00
Mark Whitehorn c81c34b147 add sPort telemetry handling into frsky_telemetry daemon 2016-01-24 11:22:18 +01:00
Mark Whitehorn 29d759768e clean up structure 2016-01-24 11:22:18 +01:00
Mark Whitehorn 42f9079683 move sPort_telemetry.c to src/drivers/frsky_telemetry and rename daemon
to frsky_telemetry
2016-01-24 11:22:18 +01:00
Mark Whitehorn a402b3beeb change frsky_telemetry default port to USART8 for pixracer
add a 50msec timeout to poll calls in sPort_telemetry to prevent hangs
2016-01-24 11:22:18 +01:00
Mark Whitehorn 214709dc89 move smartport telemetry to new module 2016-01-24 11:22:18 +01:00
Mark Whitehorn 47dcf71554 initial test of FrSky SmartPort telemetry 2016-01-24 11:22:18 +01:00