Commit Graph

260 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho 8cce3067f4 AP_Baro: examples use millis/micros/panic functions 2015-11-20 12:29:38 +09:00
Caio Marcelo de Oliveira Filho 5a280838f8 AP_Baro: use millis/micros/panic functions 2015-11-20 12:29:31 +09:00
Lucas De Marchi 977f6aaf15 AP_Baro: MS5611: remove empty statement 2015-11-11 13:48:48 +11:00
Lucas De Marchi 94d01934f7 AP_Baro: MS5611: reduce OSR to 1024
This is the same change as done in PX4:

	This reduces self-heating of the sensor which reduces the amount
	of altitude change when warming up. Apparently some individual
	sensors are severely affected by this.

	Unfortunately it raises the noise level, but Paul is confident
	it won't be a significant issue.
2015-11-11 13:48:48 +11:00
Andrew Tridgell 840c9e65bb AP_Baro: don't notify the GCS of new pressure reference too often 2015-11-09 14:34:07 +11:00
Peter Barker 1b13315092 AP_Baro: notify GCS of calibration 2015-11-09 09:23:20 +11:00
Lucas De Marchi 8eef58a8c2 AP_Baro: remove check for AVR CPUs
Remove the checks for HAL_CPU_CLASS > HAL_CPU_CLASS_16 and
HAL_CPU_CLASS >= HAL_CPU_CLASS_75. Corresponding dead code will be
removed on separate commits.
2015-11-04 12:14:14 +11:00
Lucas De Marchi 4bd8b2ae35 AP_Baro: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 2015-11-04 12:14:11 +11:00
Lucas De Marchi 831d8acca5 Remove use of PROGMEM
Now variables don't have to be declared with PROGMEM anymore, so remove
them. This was automated with:

    git grep -l -z PROGMEM | xargs -0 sed -i 's/ PROGMEM / /g'
    git grep -l -z PROGMEM | xargs -0 sed -i 's/PROGMEM//g'

The 2 commands were done so we don't leave behind spurious spaces.

AVR-specific places were not changed.
2015-10-30 14:35:16 +09:00
Lucas De Marchi 2c38e31c93 Remove use of PSTR
The PSTR is already define as a NOP for all supported platforms. It's
only needed for AVR so here we remove all the uses throughout the
codebase.

This was automated with a simple python script so it also converts
places which spans to multiple lines, removing the matching parentheses.

AVR-specific places were not changed.
2015-10-30 14:35:04 +09:00
Lucas De Marchi 386547427d AP_Baro: support MS5611 on second i2c bus 2015-10-22 12:04:52 +11:00
wsilva32 da9118fbd0 AP_Baro: average SITL baro measurements using update() 2015-10-21 10:25:08 +11:00
Lucas De Marchi 4d3229daa2 AP_Baro: remove check for HAL_CPU_CLASS
We don't support HAL_CPU_CLASS <= HAL_CPU_CLASS_16 anymore. This makes
BARO_MAX_INSTANCES and BARO_MAX_DRIVERS constant for all supported
boards.
2015-10-21 10:05:18 +11:00
Caio Marcelo de Oliveira Filho 24178c3e10 AP_Baro: remove unnecessary includes in example 2015-10-21 09:16:10 +11:00
Caio Marcelo de Oliveira Filho ec52df991c build: compile only the HAL files needed by the board
Instead of requiring every program to specify the HAL related modules,
let the build system do it (in practice everything we compiled depended
on HAL anyway). This allow including only the necessary files in the
compilation.
2015-10-21 09:16:07 +11:00
Caio Marcelo de Oliveira Filho 2e464a53c2 AP_HAL: make code not depend on concrete HAL implementations
The switching between different AP_HAL was happening by giving different
definitions of AP_HAL_BOARD_DRIVER, and the programs would use it to
instantiate.

A program or library code would have to explicitly include (and depend)
on the concrete implementation of the HAL, even when using it only via
interface.

The proposed change move this dependency to be link time. There is a
AP_HAL::get_HAL() function that is used by the client code. Each
implementation of HAL provides its own definition of this function,
returning the appropriate concrete instance.

Since this replaces the job of AP_HAL_BOARD_DRIVER, the definition was
removed.

The static variables for PX4 and VRBRAIN were named differently to avoid
shadowing the extern symbol 'hal'.
2015-10-21 09:16:07 +11:00
José Roberto de Souza c53e9d1ff0 AP_Baro: Fix typo 2015-10-16 10:05:03 +11:00
José Roberto de Souza 9a98eb35fc AP_Baro: Add MS5637 over I2C to init() 2015-10-16 10:05:03 +11:00
José Roberto de Souza c373ce34d1 AP_Baro: MS56XX: Some minor fixes 2015-10-16 10:05:03 +11:00
José Roberto de Souza d9931b5f34 AP_Baro: Add support to MS5637
As AVR2560 is not supported anymore and do integer operations is
usually faster than float-point the _calculate() implementation was
done using only integer operations and as more close to what
datasheet says.
2015-10-16 10:05:03 +11:00
raspilot 831bb554e7 AP_Baro_MS5611: suspend timer when init to prevent other SPI drivers grabbing the bus. 2015-10-02 09:54:55 +10:00
mirkix ba4db34c83 AP_Baro: Prevent busy waiting 2015-10-02 09:49:12 +10:00
Julien BERAUD 3b5d73b1fe AP_Baro_MS5611: Fix state machine in case of error
If there is a read error, reading from the adc will return 0 but moreover,
we need to re-initiate a read or else we are stuck forever.

From MS5611-01BA03 datasheet, p. 10, CONVERSION SEQUENCE:
"After the conversion, using ADC read command the result is clocked out with the MSB first.
If the conversion is not executed before the ADC read command, or the ADC read command is
repeated, it will give 0 as the output result."
2015-09-23 09:19:22 +10:00
Andrew Tridgell a5462fec0b AP_Baro: allow selection of primary barometer and add 3rd baro
this is useful for external I2C barometers on a PH2
2015-09-14 14:27:41 +10:00
Gustavo Jose de Sousa bcd5dff774 AP_Baro: MS56XX: do not change change state on error
If we have an error in the SPI or I2C transaction we should not change
the state. Otherwise we might read a temperature when the sensor is
reporting pressure and vice-versa.
2015-09-01 20:26:06 +10:00
Gustavo Jose de Sousa 1f29e18375 AP_Baro: make AP_SerialBus::write() return success or failure for MS56XX 2015-09-01 20:26:05 +10:00
Tom Pittenger 749c0c190f AP_Baro - fix BARO_ALT_OFFSET param
This param seems to have been un-implemented. This is putting it back in. Adds a meter offset to the calculated altitude form the baro sensors.
Also changes it from int8 to float
2015-08-26 13:16:05 +10:00
Gustavo Jose de Sousa f18802bc46 AP_Baro: standardize inclusion of libaries headers
This commit changes the way libraries headers are included in source files:

 - If the header is in the same directory the source belongs to, so the
 notation '#include ""' is used with the path relative to the directory
 containing the source.

 - If the header is outside the directory containing the source, then we use
 the notation '#include <>' with the path relative to libraries folder.

Some of the advantages of such approach:

 - Only one search path for libraries headers.

 - OSs like Windows may have a better lookup time.
2015-08-11 16:28:42 +10:00
Grant Morphett 312184dd13 AP_Baro: coverity fixes - add param init in constructor 2015-07-30 12:37:08 +10:00
Randy Mackay 5732a6a144 Baro: update climb rate only if healthy 2015-07-29 16:32:49 +09:00
Julien BERAUD d407737434 AP_Baro: added MS5607 support 2015-07-10 16:46:29 +10:00
Andrew Tridgell 282efe2d57 AP_Baro: fixed example to run accumulate at 50Hz 2015-07-10 09:59:35 +10:00
Andrew Tridgell 4368f922a3 AP_Baro: convert example from .pde to .cpp 2015-06-01 16:58:10 +10:00
Lucas De Marchi df5652fa87 AP_Baro: use functor macros
Functor is not yet being used but let's make is macro fallback to the
previous Delegate implementation for easy of transition between the two.
2015-05-26 13:46:52 +10:00
ziltoid2 23787cf695 AP_Baro: use ground_temperature instead of calibration_temperature for alt calculation 2015-05-20 11:42:21 +10:00
Andrew Tridgell 48fb7f8159 AP_BARO: revert AP_Math class change 2015-05-05 13:27:05 +10:00
Tom Pittenger 0b29848277 AP_Baro: compiler warnings: apply is_zero(float) or is_equal(float) 2015-05-05 13:26:56 +10:00
Andrew Tridgell 7d9d594283 AP_Baro: fix for HAL_SITL rename 2015-05-05 09:45:55 +10:00
Randy Mackay 55298a4c73 Baro: fix example sketch 2015-05-02 17:25:44 +09:00
Randy Mackay 1b381b5675 Baro: get_air_density_ratio gets div-by-zero check 2015-04-29 14:36:20 +09:00
Jonathan Challinger f381ef93e8 AP_Baro: add get_air_density_ratio 2015-04-29 14:36:10 +09:00
Tom Pittenger 4191c44bbd Baro: fix compile warning re member init order 2015-04-24 14:15:11 +09:00
Andrew Tridgell 2e9d2e6449 AP_Baro: load only HIL backend for hil_mode 2015-03-13 22:52:55 +11:00
Andrew Tridgell d040318014 AP_Baro: removed unused define 2015-03-13 18:46:17 +11:00
Randy Mackay 4e7d92094c Baro: remove glitch detection 2015-03-13 16:40:29 +09:00
Andrew Tridgell 1f70b34cbc AP_Baro: fixed baro startup on PXF cape 2015-03-13 13:48:41 +11:00
Andrew Tridgell beeb9173ea AP_Baro: change for new PX4 paths 2015-02-14 12:25:43 +11:00
Andrew Tridgell ac3dd87790 AP_Baro: added hil_mode support 2015-02-10 09:53:30 +11:00
Randy Mackay bb4204c045 Baro: fix example sketch 2015-01-28 17:15:37 +09:00
Randy Mackay c93e7a69a7 Baro: init external_temperature in constructor 2015-01-12 13:56:35 +09:00