Commit Graph

11993 Commits

Author SHA1 Message Date
Mark Charlebois c77448747e Merge branch 'linux' of http://github.com/mcharleb/Firmware into linux 2015-04-22 08:32:42 -07:00
Mark Charlebois 9ec7020e02 Make a local function static
platforms/posix/main.cpp had a local function that wasn't static.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 08:31:41 -07:00
Mark Charlebois 7aac0e94db Posix: disable stack size check
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-22 07:50:45 -07:00
Mark Charlebois 93dea668dc Posix: make simulated devices always pass self tests
To facilitate testing, the simulated devices always return OK for
self tests.

rc.S was also upated to set CAL_XXXY_ID to the devid so tests pass the
calibration check.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 23:29:07 -07:00
Mark Charlebois 36a9f7a818 Posix: fixed calls to open that should be px4_open
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 23:26:14 -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 da29004a26 Sync state_machine_helper_posix to state_machine_helper
state_machine_helper_posix.cpp was out of sync with
state_machine_helper_posix.cpp.

Added debug to detect when sensors is started before uorb.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 22:04:01 -07:00
Mark Charlebois 3f7d4de74a Posix: fixed ioctl calls to be px4_ioctl
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 17:26:07 -07:00
Mark Charlebois 19162ba5be Posix: Changed PreflightCheck to read Vdev
PreflightCheck was failing because it was trying to read actual
devices instad of virtual devices.

ADCSIM had a LINUXTEST ifdef that was removed.

posix_run.sh was using the wrong path

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 17:14:52 -07:00
Mark Charlebois f3b5076d70 Linux to posix conversion
Changed "linux" target to "posix". Most of the changes are shared with
QuRT and with OSX. The Linux specific parts are in for i2c which uses
<linux/i2c.h> and <linux/i2c-dev.h>.

There is also a check for __PX4_LINUX in mavlink for a tty ioctl that is
not supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-21 09:53:09 -07:00
Lorenz Meier 40faa98416 Linux: Fix unit tests 2015-04-21 09:23:36 +02:00
Lorenz Meier 31818b30b6 Linux: Ignore generated messages 2015-04-21 09:23:26 +02:00
Mark Charlebois 0b649204b0 Make nuttx the default PX4_TARGET_OS
This should make the CI builder happy again.

Also fixed another itdef that should have been ifeq

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 14:35:56 -07:00
Mark Charlebois 4749974d5c Made nuttx the default PX4_TARGET_OS
The CI builder should work when nuttx is set to be the default

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 14:22:51 -07:00
Mark Charlebois 260bbcb64a Nuttx: fixups after rebase on Linux
Seems that mavlink_receiver_linux.cpp inherited the history
from mavlink_receiver.cpp so updates went to it vs mavlink_receiver_nuttx.cpp

Two module.mk files used ifdef instead of ifeq.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:57:02 -07:00
Mark Charlebois 710fe76cdf Linux: minor fixups for rebase to master
These changes were required after the rebase to master.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:11:27 -07:00
Mark Charlebois 36d17a061e Linux: Update mavlink files to track nuttx upstream
Modified LInux impl to track changes to nuttx impl.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:09:54 -07:00
Mark Charlebois 612579c809 Removed check for isfinite as no longer needed
PX4_ISFINITE resolves the definition of isfinite.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:08:06 -07:00
Mark Charlebois 455b0dcaff Fixed parenthesis bug
Clang found the following:
       if (fabsf(airspeed.indicated_airspeed_m_s > 6.0f))

which is doing fsbsf( bool )

Fixed to be:
       if (fabsf(airspeed.indicated_airspeed_m_s) > 6.0f)

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:04:46 -07:00
Mark Charlebois 94b622998a Silence use of gnu extension gnu-array-member-paren-init
Added -Wno-gnu-array-member-paren-init to toolchain_native.mk

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 12:02:23 -07:00
Mark Charlebois b7a5e4df58 Linux: Fixed px4_ioctl calls that should be ::ioctl
If simulate is not true, then a read I2C device is present.
The global scope ioctl should be called on _fd, not px4_ioctl.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois f44a23bc26 Check stack for commander only for NuttX
Turn off check of stack if not a NuttX build

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois c9d4f02541 QuRT: added sched.h
Added the pieces required from sched.h

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois 6ce0b7b753 QuRT: added missing make pieces
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois 0d523d57af QuRT: Added nfds_t type
DSPAL does not yet provide poll.h and all we need is the defintion of
nfds_t.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois 5d60437164 Qurt: Added more support for the QuRT target
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois 47beddc88f Linux: Fixed hil crash with no args passed
The hil module did not check for argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois 1126e7ed52 Added config files for QuRT
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois e9c2e08770 Added initial QuRT support
Added the basic files to start building for QuRT

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:51 -07:00
Mark Charlebois dc52bb7703 Linux: Added support for drivers/rgbled
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois 89a1799e61 Linux: Changed /vdev/... back to to /dev/
Some virtual devices were mapped to /vdev.
Putting them back to /dev.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -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 694427e4ba Converted commander to use px4_posix calls
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 88dc6ec1e5 Simulator: use template for Reports
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois 2f5bfe0c16 Linux: quelch clang-3.5 not found warnings
Quelch stderr when looking for clang-3.5.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois 55581cc438 Linux: adcsim fixes
Call to read should have been px4_read.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois 93c39e6d1d Linux: Added barosim support to simulator
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois 89bc1b86b2 Linux: connected gyrosim to Simulator
Simulator gets incoming MPU data and gives raw MPU data to the
gyrosim sensor when read.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:50 -07:00
Mark Charlebois facc2faf04 Linux: added hil support
The HIL driver now runs in the Linux build

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:37:49 -07:00
Mark Charlebois ac1679dbc3 Added simulator
Simulator listens for UDP input data at port 9876.

Data is for now comma separated. Not yet connected to the various sim
classes: accelsim, gyrosim, magsim.

Barometer measurements not yet supported.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:49 -07:00
Mark Charlebois f00dc44475 Linux: fixed px4_task_t to be int
px4_task_t is negative for failure conditions. It was set mistakenly to
pthread_t (which is unsigned) for LInux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:49 -07:00
Mark Charlebois a1501fa368 Linux: Default to use clang
Fixed to use clang 3.4.2 on Ubuntu 12.04

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:49 -07:00
Mark Charlebois 639afeb28f Fixed issue with argc check
Was checking if argc < 1 and then accessing argv[1]. Fixed by
checking if argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois edf8677c37 Linux: use string to store task name
Converted px4_linux_tasks to C++ so the task struct can use a
string. Sometimes the name string was in the stack of the calling
function and goes out of scope.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois 87a8289a22 Linux: changed adc to adcsim and add barosim
The name of the app was adc but should have been adcsim.
Added a barometer simulator.

This will allow ms56711_linux to depend on real devices and not
simulation.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois ddf75dd55a Linux: added ADC simulator
The sensor module is now able to run after the simulation modules are
started.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois 2eaa2f06e7 Linux: fised printf param to work on 32 and 64 bit targets
Use %zd instead of %d or %ld for sizeof(x).

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois 410f86b767 Linux: Added simulated gyro
The code is based on mpu6000.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois ec1b77c9e1 Linux: GCC static data is 16byte aligned, messes up param
GCC 4.8 and higher implement 16 byte static data alignment on 64-bit.
This means that the 24-byte param_info_s variables are 16 byte aligned
by GCC and that messes up the assumption that the address of the second
parameter is at &param[0]+sizeof(param[0]).
When compiled with clang it is true, with gcc is is not true.

See https://llvm.org/bugs/show_bug.cgi?format=multiple&id=18006

The fix is needed for GCC >=4.8 only. Clang works fine without this.

Added __attribute__((aligned(16))) to first member of param_info_s.

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