40 Commits

Author SHA1 Message Date
Daniel Agar
4937449890 move parameter unittest into systemcmds 2017-06-12 12:18:53 -04:00
Daniel Agar
e927f3e040 clang-tidy modernize-use-nullptr 2017-02-01 22:15:50 -05:00
Daniel Agar
751909cd4e clang readability-braces-around-statements (#6298) 2017-01-11 17:01:51 -05:00
Beat Küng
dc6ca7c372 VDev & CDev: dynamically allocate & resize _pollset array
In most cases, really only 1 element is needed. The dynamic allocation
handles cases where more are necessary. This is all done within a locked
state, so no races can occur.

Frees roughly 2.3KB RAM.
2016-11-14 10:27:57 +01:00
Beat Küng
9448e0d673 vdev: remove wrong comment 2016-10-23 15:25:20 +02:00
Lorenz Meier
d9d90881a7 VDev: Code style fix 2015-12-06 13:42:38 +01:00
Lorenz Meier
314bb49bce Unit tests: Workaround for driver framework. Now unit tests are fully enabled 2015-12-06 12:19:24 +01:00
Lorenz Meier
bffce0c9eb VDEV: Less verbose 2015-11-22 14:00:31 +01:00
Mark Charlebois
34410e7ce4 Changes for updated DriverFramework
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-19 19:03:10 -08:00
Mark Charlebois
618626103f Use DevMgr::getNextDevicePath()
Also, a fix for number of args passed for accelsim.

Updated to newest version of DriverFramework.

DF drvices show up now in list_devices

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-16 16:57:57 -08:00
Mark Charlebois
3f20d78dfe Fixed code style
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-16 14:01:39 -08:00
Mark Charlebois
dbe3b0e52b Re-enabling code to handle DF framework
Updated to latest DriverFramework and changed ioctl args to
unsigned int from void *.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-16 13:51:39 -08:00
Lorenz Meier
cc8f159bcc REVERT THIS COMMIT LATER: Temporarily disable the device listing 2015-11-12 15:31:38 +01:00
Lorenz Meier
437133aac4 Merged driver_framework from mcharleb 2015-11-12 15:20:15 +01:00
Mark Charlebois
efd9995a10 Ported more simulated sensors to DriverFramework
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-11-10 07:45:13 -08:00
Lorenz Meier
06987c6244 Lock vdev devmap 2015-11-02 11:06:29 +01:00
Lorenz Meier
fe216b5c5f Device: Fixed code style 2015-10-19 13:15:22 +02:00
Lorenz Meier
76508ab5b5 Device:: Move to POSIX semaphore abstraction 2015-09-20 00:27:41 +02:00
Lorenz Meier
686caf4ca4 Fix semaphore handling for device on Mac OS 2015-09-16 17:10:24 +02:00
Mark Charlebois
3a47434749 Fixes for qurt HIL build
Workaround required Eigen downgrade to 3.2. Hexagon toolchain does
not support C++11 features of newest version of Eigen.

Running make qurt_fixup will downgrade and patch Eigen for qurt.
Running make restore will revert the patch and do a git submodule update
to restore the expected Eigen version.

Added a "restore" target to undo qurt_fixup

Before doing a qurt build run:

    make qurt_fixup

That will downgrade Eigen to 3.2 and apply the require patch.
To build another target after downgrading:

    make restore

Them make the desired target (other than qurt).

Fixed type used in orb_priority to be consistent with the code
(int* was used in declaration but int32_t* used in code)

Removed unused class member variable in sensors.cpp

Added cmake fix for unit tests. The location of px4_log.c changed.

Fixed the qurt drv_hrt.c implementation to use us instead of ms for time resolution

Added px4_led.c to nuttx platform layer
Use the posix version of px4_led.c for nuttx so we don't end up with
duplicate files. It was moved out of common because it is not used by qurt.

Changed PX4_DEBUG to PX4_WARN when checking for the error condition for store_poll_waiter in vdev.cpp

Updated the px4_log.h file to make calls to the qurt_log functions.
The qurt_log function is defined in the platforms/qurt layer.

Added an option to control starting the commander module in HIL mode.

Moved the flight specific drivers to the configuration file instead of adding them
to the common tool chain file because HIL mode does not need them.

Added the uorb Subscriber and Publisher classes

Call PX4_ISFINITE macro instead of isfinite().

Added px4_led.c to nuttx platform layer
Use the posix version of px4_led.c for nuttx so we don't end up with duplicate files.
It was moved out of common because it is not used by qurt.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-25 21:59:01 -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
d81d20ff0e VDev: Add missing break 2015-06-19 11:51:37 -07:00
tumbili
fb778af8b3 increase max file descriptors to 100 2015-06-08 22:21:58 -07:00
Mark Charlebois
b4152f3daa POSIX: Fixed output for list_topics, list_devices, etc
Removed extra carriage returns in output strings

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-06-02 16:55:37 +00:00
Mark Charlebois
bd2b5e4738 Revert change to src/drivers/device/vdev.cpp
This change was not part of the orb_advert_t fix.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:42:49 -07:00
Mark Charlebois
379075d29c POSIX: Increased number of devmap entries
The orb_advertise and/or orb_publish calls were failing because
there were not enough devmap entries allocated for all the orb
topics advertised.

The number of entries was increased from 50 to 100.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-25 23:20:19 -07:00
Mark Charlebois
f1f562a94d POSIX: Fixed orb_advertise failure
There were an insufficient number of devmap entries allocated and
when they ran out, new orb_advertise requests would fail.

Also added a new logging macro for the Linux build to show the
calling pthread if enabled.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-21 15:35:11 -07:00
Mark Charlebois
30895c2dfd POSIX: fixed printf to use PX4_INFO
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-19 13:37:59 -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
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
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
02aaa403f1 Posix: removed PX4_DEVIOC* definitions
The following should not have been defined:

PX4_DIOC_GETPRIV
PX4_DEVIOCSPUBBLOCK
PX4_DEVIOCGPUBBLOCK
PX4_DEVIOCGDEVICEID

The actual defines are in drv_device.h and are:

DEVIOCSPUBBLOCK
DEVIOCGPUBBLOCK
DEVIOCGDEVICEID

DIOC_GETPRIV is defined by Nuttx, so mapped to SIOCDEVPRIVATE for POSIX

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 23:20:59 -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
a6950eb7d3 Linux: fixed bad return value
Function was always returning -ENOTTY instead of the "ret" variable.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois
400b9ebc20 Linux: fixed registration of a class of device
Previously it created 4 instances instead of the next available slot.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -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