|
|
|
@ -68,9 +68,7 @@ bool AP_Airspeed_SDP3X::init()
@@ -68,9 +68,7 @@ bool AP_Airspeed_SDP3X::init()
|
|
|
|
|
if (!_dev) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
_dev->get_semaphore()->take_blocking(); |
|
|
|
|
|
|
|
|
|
// lots of retries during probe
|
|
|
|
|
_dev->set_retries(10); |
|
|
|
@ -84,9 +82,7 @@ bool AP_Airspeed_SDP3X::init()
@@ -84,9 +82,7 @@ bool AP_Airspeed_SDP3X::init()
|
|
|
|
|
// these delays are needed for reliable operation
|
|
|
|
|
_dev->get_semaphore()->give(); |
|
|
|
|
hal.scheduler->delay_microseconds(20000); |
|
|
|
|
if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
_dev->get_semaphore()->take_blocking(); |
|
|
|
|
|
|
|
|
|
// start continuous average mode
|
|
|
|
|
if (!_send_command(SDP3X_CONT_MEAS_AVG_MODE)) { |
|
|
|
@ -97,9 +93,7 @@ bool AP_Airspeed_SDP3X::init()
@@ -97,9 +93,7 @@ bool AP_Airspeed_SDP3X::init()
|
|
|
|
|
// these delays are needed for reliable operation
|
|
|
|
|
_dev->get_semaphore()->give(); |
|
|
|
|
hal.scheduler->delay_microseconds(20000); |
|
|
|
|
if (!_dev->get_semaphore()->take(HAL_SEMAPHORE_BLOCK_FOREVER)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
_dev->get_semaphore()->take_blocking(); |
|
|
|
|
|
|
|
|
|
// step 3 - get scale
|
|
|
|
|
uint8_t val[9]; |
|
|
|
|