Commit Graph

10 Commits

Author SHA1 Message Date
Ricardo de Almeida Gonzaga 46fb57fcf1 AP_OpticalFlow: use I2CDevice interface 2016-04-29 12:01:04 -03:00
Caio Marcelo de Oliveira Filho 5b06924779 AP_OpticalFlow: use millis/micros/panic functions 2015-11-20 12:33:19 +09:00
Lucas De Marchi 0d95a9c41d AP_OpticalFlow: reduce lock region
Release the lock as soon as we can.
2015-11-05 16:12:03 +09:00
Lucas De Marchi 70edf31ca6 AP_OpticalFlow: make error path common 2015-11-05 16:12:00 +09:00
Lucas De Marchi 7b726d824d AP_OpticalFlow: remove num_errors increment due to busy bus
num_errors should be used to detect bad bus transfers, not if we
actually read something. Since we are using i2c_sem->take_nonblocking()
failing here is more likely if the bus is shared.
2015-11-05 16:11:58 +09:00
Lucas De Marchi 20c6ffc5e3 Replace use of UARTDriver::printf_P() with UARTDriver::printf()
This also starts to show warnings on places that were already using
wrong printf format strings.
2015-10-30 14:35:25 +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
Gustavo Jose de Sousa f32c4ceda9 AP_OpticalFlow: 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:38:21 +10:00
Randy Mackay 4aef64c153 OpticalFlow_Linux: reworked driver
remove PANICs from init
return semaphore if init fails
add successful initialisation check before attempting to read from sensor
structure made private where possible
formatting fixes
check I2C reads succeed
add request_measurement to request sensor to produce measurement
quit after 20 of previous 40 reads fail
throttle reads to 10hz max
2015-08-07 15:51:11 +09:00
Víctor Mayoral Vilches ed3366aaae AP_OpticalFlow: Add support for Linux
Add a Linux userspace driver for the PX4FLOW sensor.
2015-08-07 15:50:41 +09:00