Commit Graph

11971 Commits

Author SHA1 Message Date
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
Mark Charlebois 5d988381e6 Linux: Created new linker script from scratch
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois d264273d21 ACCELSIM: fixed calls to open, close, ioctl
The calls to open, close, ioctl should have been px4_open, px4_close
and px4_ioctl.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois d137c09b0b Linux: removed debug output for task creation
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -07:00
Mark Charlebois 76e28ac952 Use of != compare of floats in AttitudeEKF.c
This is a bug and is unsafe. I am not going to change the code but
it needs to be changed to a cast to int or a <= as it is unsafe to
check for equality with 0.0F.

Disabled warning for GCC 4.9 for now.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:48 -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 1d676b2e10 Moved linux/drivers/accel to linux/drivers/accelsim
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois c6498de3e1 SIM: pushed transfer stub for ms5611_sim
The MS5611_SIM class is supposed to simulate data from a real
ms5611. An externl simulator could provide an interface to
call to get data that would be returned from a transfer() call.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois 892012aa15 SIM: made transfer a virtual method
Drivers simulating HW can implement specific behavior for calls to
transfer.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois eab32572f4 Linux: Added thread safe getopt
The getopt command uses global variables and is not thread safe.

Created a minimal px4_getopt version that supports options with
or without an arg, and random placement of options on the command line.

This version modifies the order of the args in argv as does the
POSIX version of getopt.

This assumes that argv[0] is the program name. Nuttx may not support
that properly in task_spawn.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois b86b334c2f Linux: Updated copyright on simulated accelrometer source
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois 80c5812861 Linux: run socat as user not as root
If sudo is used to run socat the tty cannot be opened by a regular user

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois 440fc306a9 Added accelerometer simulator
The simulator satisfies the dependencies for an accelerometer
being present.

The accel code compiles but is not fully functional.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois 76a6f19476 Linux: Added device simulator to simulate an I2C or SPI device
The simulated device satisfies the factory pattern used by
MS5611 to create a specific I2C or SPI device instance.

For now the functions just return true, but should/could
return simulated data.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:35:47 -07:00
Mark Charlebois 4780353cd8 ms5611_i2c: don't create with nullptr for devname
I have not been able to unravel why nullptr is passed as the device
path to the constructor of ms5611_i2c.

This crashes the VDev code as it expects to create a virtual driver
with the device path passed as devname. It causes VDev to do a
strncmp with null.

Using /vdev/ms5611_i2c as the name for the now.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 92d90f7780 Linux: ms5611 open, close changed to px4_open, px4_close
Calls to open and close were used instead of px4_open and px4_close.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois f62ea8aeae Linux: added read and write function overrides for i2c
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 894611df04 Linux: Fixed argc check in sensors_main
Was checking for argc < 1, and should be argc < 2.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 058d4408cc Linux: removed debug output from shell
The command shell was spewing debug infor about the command and
parameters. Removed the debug output.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois e3efe71444 Linux: I2C implementation with simulator stub
If PX4_I2C_SIMULATE is set to 1, then the actual I2C device will
not be opened and all transfers will succeed.

If PX4_I2C_SIMULATE is false and transfer() is called, then the
appropriate ioctl is make on the actual device.

if I2C::ioctl is called via px4_ioctl() then the command fails and
a warning is printed to use I2C::transfer

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:34:12 -07:00
Mark Charlebois 78dd177e86 Linux: removed documentation of parameter
The parameter is not present in the linux implementation so removed
the documentation for the parameter.

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