49 Commits

Author SHA1 Message Date
Beat Küng
0165633bf3 board_config: remove px4_board_pwr, use px4_shutdown_request instead
px4_board_pwr has become obsolete with the addition of board_shutdown
2017-04-20 10:01:51 +02:00
James Goppert
7659402fdb WIP: valgrind runtime analysis and fixes (#6521)
* Fix several valgrind identified mem leaks

* Added callgrind target.

* px4_posix_tasks use nullptr
2017-02-17 12:36:52 -05:00
Lorenz Meier
6bd29b24f6 POSIX: Avoid missing prototype warning on some POSIX platforms 2017-02-04 21:06:21 +01:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
David Sidrane
c9f10107c0 Nuttx Upgrade:Adds sem_setprotocol 2016-12-21 08:34:21 +01:00
jwilson
9a97140ad8 Removing test code. 2016-02-19 16:59:49 +01:00
jwilson
b31472af0c Cherry-picked i22438c8
Original description:
Modified the sensor module to prevent the selection of an invalid
secondary/tertiary gyro if the primary gyro times out
2016-02-19 16:59:49 +01:00
Julian Oes
fbac24ad28 vdev_posix: switch back to CLOCK_REALTIME
Otherwise SITL doesn't work anymore, at least on Linux
2016-02-19 16:59:48 +01:00
Julian Oes
b2ad3f5fbd POSIX: get px4_poll right
Like this the timeouts are going through instead of hanging everything.
2016-02-19 16:59:47 +01:00
Lorenz Meier
15e7b19991 uORB: Block on simulation delay for orb_check() calls as well 2016-02-05 16:36:43 +01:00
Lorenz Meier
443a58cafe px4_poll() on POSIX: Block execution in simulation if required 2016-02-05 00:53:58 +01:00
Lorenz Meier
20c8c6a2fa Fix VDev formatting 2016-01-07 22:24:10 +01:00
Lorenz Meier
cb52a7eeec Raise number of max FDs for VDev 2016-01-05 22:53:27 +01:00
Lorenz Meier
fc2b9a5031 Print backtrace on file descriptor exceed error 2016-01-05 19:03:29 +01:00
Lorenz Meier
adad9271df POSIX: Warn about file descriptor exceed with associated thread name 2016-01-05 19:02:07 +01:00
Lorenz Meier
c91df50d7e VDev: fix code style 2016-01-02 09:59:06 +01:00
Lorenz Meier
55ce8c0c42 Fix QuRT build error 2016-01-02 01:27:29 +01:00
Andreas Antener
08a1797eec changed isnan checks and cmake compiler condition for apple machines 2015-12-03 15:39:41 +01:00
tumbili
f91af2221f fix sem error for linux 2015-12-01 16:51:38 +01:00
Lorenz Meier
f035f11e30 vdev posix: Code style 2015-12-01 12:43:12 +01:00
Lorenz Meier
aa36e54c93 VDEV: More active reporting 2015-12-01 11:53:00 +01:00
Lorenz Meier
5126f81aed Fix corner cases in timing and in handling poll list iteration in VDEV posix 2015-12-01 10:28:49 +01:00
Lorenz Meier
f42b338f16 VDev: Switch to a timed wait semaphore 2015-11-23 19:51:45 +01:00
Lorenz Meier
e12766826c VDev posix: Initialize HRT work 2015-11-22 14:01:52 +01:00
Lorenz Meier
c0a6635400 Lock VDEV table to prevent concurrent access 2015-11-02 10:51:53 +01:00
Lorenz Meier
fe216b5c5f Device: Fixed code style 2015-10-19 13:15:22 +02:00
Lorenz Meier
c1c235edb2 Merge branch 'cmake-2' into cmake-2-pthread 2015-09-20 10:34:03 +02:00
Lorenz Meier
76508ab5b5 Device:: Move to POSIX semaphore abstraction 2015-09-20 00:27:41 +02:00
Mark Charlebois
7d2ba97511 Fixed poll timeout bug
The SIGCONT signal was being ignored by the HRT queue thread so the
usleep was not waking up early to process new work.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-09-16 15:24:58 -07:00
tumbili
50a5fb94ad fix logic in posix access function 2015-09-03 09:56:07 +02:00
Mark Charlebois
14bf8bb277 POSIX: Critical fix for vdev_posix
Last fix for vdev_posix.cpp introduced a sleep from within
a HRT work item callback which blocks the HRT queue.

The code in uORBDevices_posix.cpp that handles message
throttling was commented out for posix. The code was re-enabled
and now seems to work.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-30 12:08:42 -07:00
Mark Charlebois
da2ac877f8 POSIX: Changed px4_poll to use hrt_work queue
QuRT's pthread_cancel implementation is lacking, and causes px4_poll to
always wait for the maximumn timeout. A cleaner implementation is provided
that uses the HRT work queue for posix targets.

In the future the posix code should be rtefactiored so that qurt (and other)
implementations that are duplicated, use the posix implementation.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-29 19:08:06 -07:00
tumbili
7043869237 VDev:
- increase max number of devices to 200
- increase max number of file descriptors to 200
- add warning if number of file descriptor exceeds max value
2015-06-23 18:32:40 +02:00
Lorenz Meier
27cec4a977 VDev POSIX: Fix non-POSIX conformant return value handling 2015-06-19 11:52:07 -07:00
Mark Charlebois
f985a48fbc Created px4_access to handle check of virtual files
uORBManager_posix.cpp did a stat to see if a file exists but the
file is actually a virtual file. Using stat was incorrect because
it required a stat buffer that was never used. The POSIX access
function is a better choice so I created a px4_access version to
handle virtual files.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-03 16:22:14 -07:00
Mark Charlebois
6343b2c56f px4_poll fix - was sleeping for usec instead of ms
There was a conversion error in the timeout (in ms)
passed in and the ts.tv_nsec field of the struct timeval.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-29 13:26:29 -07:00
Mark Charlebois
ffdc9d629c POSIX: Improved logging
The warnx and warn calls map to PX4_WARN.
Calls to errx or err genrtate a compile error.

The px4_log.h file implements a new log format:

For DEBUG and INFO:
<level> <msg>

For ERROR and WARN:
<level> <msg> (file filepath line linenum)

The verbosity can be changed by setting the macro to use
either linux_log or linux_log_verbose in px4_log.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 09:19:24 -07:00
Mark Charlebois
2f434eb395 POSIX: fixups for px4_log.h change
After merge from qurt branch, fixups for posix build

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-11 16:14:06 -07:00
Mark Charlebois
a99f916bdf POSIX: Changed px4_debug.h to px4_log.h
Also changed use of printf to PX4_WARN or PX4_INFO in posix and
qurt tests.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-11 16:04:39 -07:00
Mark Charlebois
99822038f3 POSIX: Fixed px4_open code to not create a file when opening a device
The code to created a virtual file was preventing the creation of
device nodes.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-07 10:50:23 -07:00
Mark Charlebois
5e2af2b227 POSIX: fixed return values to be posix compliant
px4_read, px4_write, and px4_opctl were not returning the correct
value on error. They were returning -errno vs -1.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-07 09:38:03 -07:00
Mark Charlebois
6db77dc8bb Experimental virtual file support
QuRT does not have a filesystem, so creating a virtual filesystem
that could be implemented as an in-memory file or a remote file
over fastRPC.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-06 22:12:45 -07:00
Mark Charlebois
d913ec8dc9 Changed device::px4_device_handle_t to device::file_t
This change allowed the _posix.cpp file changes to be merged
back into the original files.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 17:49:35 -07:00
Mark Charlebois
3336fce1f4 QuRT and POSIX changes
Partial commit of the changes for QuRT and related changes for POSIX

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-24 00:52:44 -07:00
Mark Charlebois
d2f0572ce6 Linux: added builtins to show devices and topics
list_devices will list virtual devices starting with "/dev/".
list_topics will list topics ("/obj/")

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
bba26c3430 Linux: enabled commander module
The commander module now compiles for Linux.

state_machine_helper_linux.cpp iterates over the virtual devices vs
all devices under /dev as per NuttX when disabling publishing.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois
f0312d2da0 Linux: Added commands to show threads and devices
The list_tasks and list_devices commands will show
lists of running px4 threads and created virtual device nodes.

The list_builtins command was removes and the list of commands
will be shown if return is pressed.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois
ccd18929fc Linux: changed CDev to VDev for virtual device implementation
To avoid confusion when a real device and a virtual device is
being used, changed CDev to VDev for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois
8c8f57b5b4 Fixed std::isfinite vs isfinite differences
Added PX4_ISFINITE(x) to px4_defines.h to handle the differences on
NuttX and Linux.

This change also picked up some file renaming for virtual character devices

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00