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>
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>
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>
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>
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>
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>
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>
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>
list_devices will list virtual devices starting with "/dev/".
list_topics will list topics ("/obj/")
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
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>
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>
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>
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>
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>
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 ¶m[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>