Commit Graph

96 Commits

Author SHA1 Message Date
Lorenz Meier b37082e390 MS5611: Run SPI bus faster 2016-01-23 13:32:42 +01:00
Lorenz Meier 1474ddbb78 MS5611: Ensure to set the lockmode at the right location 2016-01-23 13:23:32 +01:00
Lorenz Meier 871b4b482e Do not enable new bus sync yet 2016-01-22 18:07:27 +01:00
Lorenz Meier c659d7851f MS5611: Use the right locking mechanism on Pixracer 2016-01-22 17:12:13 +01:00
Lorenz Meier 415e42f5de MS5611: Use baro SPI device 2016-01-15 22:44:22 +01:00
Mark Whitehorn ecbcfe838b clean up, change SPI2 clock back to 12MHz and remove debug prints 2016-01-14 17:55:54 +01:00
Mark Whitehorn 4952d05652 debugging ms5611 on spi2 2016-01-14 17:55:54 +01:00
Stefan 5c1b84f16a Update ms5611_i2c.cpp
spelling mistakes
2016-01-11 08:37:43 +01:00
Lorenz Meier 67087c6428 MS5611: Fix breakage introduced by failed Qualcomm MS5611 port 2015-10-11 15:43:45 +02:00
Lorenz Meier 0490046af4 MS5611: Increase the requirements about the PROM contents and CRC. 2015-10-06 17:22:38 +02:00
Lorenz Meier fa5071b3c5 Remove module.mk files to prevent confusion of adopters upgrading 2015-10-06 11:23:20 +02:00
Lorenz Meier 6ef94e0dfb Merged master into cmake-2 2015-09-20 10:33:39 +02:00
Lorenz Meier b067a0c094 Merge branch 'ekf_voting_priority' 2015-09-19 10:51:01 +02:00
James Goppert 676a3d230c Work on px4io firmware building. 2015-09-13 23:20:00 -04:00
James Goppert e55af00222 Removed weak attributes. 2015-09-13 14:40:27 -04:00
James Goppert 1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Lorenz Meier ebfae73108 MS5611 code style fix 2015-09-05 22:06:15 +02:00
Lorenz Meier 299ccab3ae MS5611: Fix build error 2015-08-30 11:37:26 +02:00
Simon Wilks 384047787a Fix travis/clang report of overloaded virtual functions. 2015-08-18 23:01:52 +02:00
Simon Wilks 4eef65f313 Enable ms5611 driver and fix build errors. 2015-08-18 23:01:52 +02:00
Mark Charlebois a589d15c52 Refactored debug() and log() in CDev
These functions used vprintf which is not available on all platforms.
They also do not enable line and file debug output.

Changed to macros that preserve the output format.  Uses new macro that
can be used to implement per object, runtime selectable logging

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-08-11 12:07:06 -07:00
Lorenz Meier d19de58102 Merge branch 'master' of github.com:PX4/Firmware into master_release 2015-06-27 11:54:17 -07:00
Andrew Tridgell 5e27b7bc31 ms5611: fixed the i2c device on NuttX. This was left-over debugging noise from the POSIX bringup. 2015-06-27 15:11:03 +02:00
Lorenz Meier 454becdae5 Merged release_v1.0.0 branch into master 2015-06-25 21:45:17 +02:00
Lorenz Meier 73d179fb59 MS5611 driver: Fix reeset logic via I2C, minor code style fixes. Fixes #2007, identified by Kirill-ka 2015-06-15 17:28:26 +02:00
Mark Charlebois 1ca05aaa64 orb_advert_t changed to void * and checks changed to nullptr
The existing orb_advert_t use thoughout the code sometimes tries
to treat it as a file descriptor and there are checks for < 0
and ::close calls on orb_advert_t types which is an invalid use
of an object pointer, which is what orb_advert_t really is.

Initially I had changed the -1 initializations to 0 but it was
suggested that this should be nullptr. That was a good recommendation
but the definition of orb_advert_t had to change to void * because
you cannot initialize a uintptr_t as nullptr.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:42:49 -07:00
Mark Charlebois a734fc96d1 extensive orb_advert_t fixes
The calls to orb_advertise were being mishandled throughout the code.
There were ::close() calls on memory pointers, there were checks
against < 0 when it is a pointer to a object and values larger than
0x7ffffffff are valid. Some places orb_advert_t variables were
being initialized as 0 other places as -1.

The orb_advert_t type was changed to uintptr_t so the pointer value
would not be wrapped as a negative number. This was causing a failure
on ARM.

Tests for < 0 were changed to == 0 since a null pointer is the valid
representation for error, or uninitialized.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-05-27 14:41:33 -07:00
Ban Siesta 362fc205b3 drivers: various whitespace 2015-05-24 10:05:42 +01:00
Ban Siesta 21dfd0243d drivers: use new ringbuffer namespace everywhere 2015-05-24 10:04:38 +01: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
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 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 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 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 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 62eb403e4d Linus: print format fixes to build with clang on IFC6410
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:15:12 -07:00
Mark Charlebois cd30b4d5ca Linux: added I2C class
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois 2feeecdab1 Linux: Added config and stubs to compile I2C device for Linux
Not yet functional. Full implementation will provide an IOCTL interface to
do bi-directional transfer. will model the interface after Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:13:24 -07:00
Mark Charlebois 4a6bd4ddc0 Linux: replaced getopt in ms5611_linux.cpp
ms5611 uses getopt to parse args but the static variable
optind was not being properly updated.

Replaced use of external getopt call with simple parser;

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 99399115f2 Linux: Minor fixes of error caught by gcc-4.9.1
- Missing static declarations for functions not used outside a file.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois d013ac0927 Support for building more modules with Linux
Added more queue support to linux/px4_layer.

Use virt char devices for ms5611, and mavlink.

Added more HRT functionality. uORB latency test
now fails. Likely due to bad HRT impl for Linux.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 11:07:00 -07:00
Mark Charlebois 9758112e31 Use px4_config.h instead of nuttx/config.h
Modified code to use OS independent header file for config settings.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
2015-04-20 10:55:41 -07:00
Daniel Agar c2abb0f82a fix code style if trivial one line difference 2015-03-19 23:49:36 +01:00
Lorenz Meier a27395a15d MS5611: Move to 0 based indices 2015-02-09 22:56:24 +01:00
Andrew Tridgell 52bff67076 ms5611: removed debug code 2015-02-01 22:13:09 +01:00
Andrew Tridgell 04a9050410 ms5611: allow for all 4 bus combinations in ms5611 driver
this uses the same table driven approach as the hmc5883 driver, and
allows for a ms5611 baro on any of the 4 bus combinations. A simple
"ms5611 start" will start all baros that are found.
2015-02-01 13:09:44 +01:00
Lorenz Meier d851a630d8 Move all drivers to multi pub/sub API 2015-01-29 16:33:53 +01:00
Lorenz Meier 6324513b91 MS5611: Comment-only fix 2015-01-17 18:48:41 +01:00