airspeed: use _retries=2 for I2C retries once initialised

airspeed sensors often need to be on longer cables due to having to be
outside the prop wash.
This commit is contained in:
Andrew Tridgell
2014-11-26 07:35:32 +01:00
committed by Lorenz Meier
parent 8e932cec10
commit 4724c05047
+6 -4
View File
@@ -159,13 +159,15 @@ out:
int int
Airspeed::probe() Airspeed::probe()
{ {
/* on initial power up the device needs more than one retry /* on initial power up the device may need more than one retry
for detection. Once it is running then retries aren't for detection. Once it is running the number of retries can
needed be reduced
*/ */
_retries = 4; _retries = 4;
int ret = measure(); int ret = measure();
_retries = 0;
// drop back to 2 retries once initialised
_retries = 2;
return ret; return ret;
} }