74 Commits

Author SHA1 Message Date
Daniel Agar
e468a9bbcc move systemlib/pwm_limit to standalone lib 2018-06-12 09:06:30 +02:00
Daniel Agar
d73d20bcce systemlib delete unused systemlib.h 2018-06-12 09:06:30 +02:00
Daniel Agar
ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Simone Guscetti
4c6daf0748 libtunes: Update tunes and mkblctrl to use the tune_definition 2018-03-19 14:15:52 +01:00
Simone Guscetti
a4659b1228 mkblctrl: Repalce old tune interface with the new one
untested on real hardware
2018-01-29 09:45:59 -05:00
Daniel Agar
53595bac0e board support add px4_i2c_bus_external/px4_spi_bus_external 2017-11-20 23:44:31 +01:00
Julien Lecoeur
89642a9203 Move src/module/systemlib/mixer to src/lib/mixer 2017-11-15 09:56:10 +01:00
Daniel Agar
0da2dca8c1 drivers remove device _debug_enabled 2017-09-25 10:30:22 -04:00
Daniel Agar
26f00609ac multirotor_motor_limits only publish for MC 2017-09-19 02:25:30 +01:00
Daniel Agar
58268c832c drivers remove extra semicolons 2017-09-16 21:29:52 +01:00
Daniel Agar
fc4831d625 astyle src/drivers/mkblctrl 2017-01-29 01:18:32 +01:00
Lorenz Meier
13dc938de2 MK driver: Fix header 2016-12-27 21:00:51 +01:00
David Sidrane
dcc2d1c3d1 I2C changes for upstream NuttX per trasaction freq control 2016-12-21 08:34:20 +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
Daniel Agar
76387b1693 uorb autogeneration 2016-05-14 11:27:07 +02:00
Daniel Agar
3bda6e0883 mkblctrl_params.c param metadata 2016-05-13 20:25:21 -04:00
Daniel Agar
6888545037 remove @unit enum 2016-03-25 20:33:25 -04:00
Daniel Agar
e285e509c1 mkblctrl param @unit 2016-03-13 18:03:21 +01:00
Lorenz Meier
9e34124210 mkblctrl: Fixed code style 2015-10-19 13:17:00 +02:00
Lorenz Meier
fa5071b3c5 Remove module.mk files to prevent confusion of adopters upgrading 2015-10-06 11:23:20 +02:00
James Goppert
1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Mark Charlebois
a589d15c52 Refactored debug() and log() in CDev
These functions used vprintf which is not available on all platforms.
They also do not enable line and file debug output.

Changed to macros that preserve the output format.  Uses new macro that
can be used to implement per object, runtime selectable logging

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-11 12:07:06 -07:00
Lorenz Meier
4565f57468 Merged release_v1.0.0 into master 2015-05-27 15:28:41 -07:00
Lorenz Meier
e07731de7a Move esc_status to generated topics 2015-05-27 15:21:31 -07:00
Mark Charlebois
a734fc96d1 extensive orb_advert_t fixes
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.

The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.

Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:41:33 -07:00
Mark Charlebois
c5237f7f6f Removed extra abstracton layer in systemlib
The calls to task_spawn_cmd, kill_all, and systemreset  were wrappers
around the px4_{task_spawn_cmd|kill_all|systemreset} implementations.

Removed the wrappers and changed all calls to the px4_ equivalents.

NuttX specific code was moved into px4_tasks.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 14:43:11 -07:00
Mark Charlebois
9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Mark Charlebois
bf429188b4 Reverted: Use OS independent API for task creation/deletion
Keep existing API use in code. Bind the use of the OS independent
implementation in the systemlib layer.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:49:44 -07:00
Mark Charlebois
ddb32742eb Use OS independent API for task creation/deletion
Calls to task_delete and task_spawn_cmd are now
px4_task_delete and px4_task_spawn_cmd respectively.

The px4_tasks.h header was added to the affected files
and incusions of nuttx/config.h were removed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:49:44 -07:00
Roman Bapst
555e96a37a fixed publication of mixer limit flags 2015-04-10 20:26:38 +02:00
NosDE
3de63dee6c interface for min and max rc added 2015-02-28 20:29:03 +01:00
NosDE
e4ad2f8e48 cmd switch for min_rc and max_rc added 2015-02-23 07:17:31 +01:00
NosDE
3f45f51d7a mkblctrl - rework and bugfix - test ok 2015-02-18 16:55:17 +01:00
NosDE
5fddb89c3e mkblctrl - rework and bugfix 2015-02-18 16:55:05 +01:00
Thomas Gubler
84ff3c671d Merge remote-tracking branch 'upstream/master' into ros_messagelayer_merge2_attctrl_posctrl
Conflicts:
	src/drivers/px4fmu/fmu.cpp
2015-02-01 11:06:47 +01:00
Lorenz Meier
d9d9a59ce4 MKBL: Move to topic groups 2015-01-29 16:33:54 +01:00
Thomas Gubler
14aa5f9441 add topic header includes 2015-01-25 15:00:35 +01:00
Pavel Kirienko
1bf4270e3e Update ORB topic 'esc_status' 2014-10-13 17:01:34 +04:00
Lorenz Meier
aaf2652e26 MKBLCTRL: optimize for size 2014-07-12 19:34:58 +02:00
Don Gagne
92adbe9216 Fix compiler warnings 2014-06-29 17:47:24 -07:00
Don Gagne
367613a1b5 Fix tabbing 2014-06-29 13:32:58 -07:00
Don Gagne
d5b5dcef24 Fix bugs found through compiler warnings 2014-06-29 12:01:43 -07:00
Lorenz Meier
29ffb3bad3 mkblctrl: Moved motor data struct into class 2014-05-12 22:11:28 +02:00
Lorenz Meier
df7d595999 Remove noreturn attribute from all drivers that actually can return 2014-05-09 09:19:44 +02:00
Lorenz Meier
267b78f072 Fix of errors triggered by more pedantic compile options 2014-04-21 21:31:30 +02:00
marco
a8b3381ca9 BL-Ctrl 3.0 fix 2014-02-17 21:29:14 +01:00
Lorenz Meier
399d59483e Fixed code style 2014-02-05 09:36:22 +01:00
Lorenz Meier
94b162d0e0 Fixed up nullptr handling 2014-02-05 09:34:21 +01:00
marco
1ef7320e0c startup rewrite 2014-02-04 16:50:22 +01:00