This commit is contained in:
Daniel Agar 2022-04-20 16:19:41 -04:00
parent 9ae942c67a
commit 230e7bdbc6
No known key found for this signature in database
GPG Key ID: FD3CBA98017A69DE
6 changed files with 24 additions and 9 deletions

View File

@ -92,7 +92,6 @@ int AK09916::probe()
const uint8_t WIA2 = RegisterRead(Register::WIA2);
if ((WIA1 == Company_ID) && (WIA2 == Device_ID)) {
_retries = 1;
return PX4_OK;
} else if (WIA1 != Company_ID) {
@ -101,6 +100,10 @@ int AK09916::probe()
} else if (WIA2 != Device_ID) {
DEVICE_DEBUG("unexpected WIA2 0x%02x", WIA2);
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;

View File

@ -91,12 +91,15 @@ int AK8963::probe()
const uint8_t WIA = RegisterRead(Register::WIA);
if (WIA == Device_ID) {
_retries = 1;
return PX4_OK;
} else {
DEVICE_DEBUG("unexpected WIA 0x%02x", WIA);
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;

View File

@ -93,14 +93,16 @@ int BMM150::probe()
PX4_DEBUG("POWER_CONTROL: 0x%02hhX, CHIP_ID: 0x%02hhX", POWER_CONTROL, CHIP_ID);
if (CHIP_ID == chip_identification_number) {
_retries = 1;
return PX4_OK;
} else if ((CHIP_ID == 0) && !(POWER_CONTROL & POWER_CONTROL_BIT::PowerControl)) {
// in suspend Chip ID read (register 0x40) returns “0x00” (I²C) or high-Z (SPI).
_retries = 1;
return PX4_OK;
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;

View File

@ -89,12 +89,15 @@ int IST8310::probe()
const uint8_t WAI = RegisterRead(Register::WAI);
if (WAI == Device_ID) {
_retries = 1;
return PX4_OK;
} else {
DEVICE_DEBUG("unexpected WAI 0x%02x", WAI);
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;

View File

@ -85,8 +85,6 @@ void QMC5883L::print_status()
int QMC5883L::probe()
{
_retries = 1;
for (int retry = 0; retry < 3; retry++) {
// first read 0x0 once
const uint8_t cmd = 0;
@ -99,6 +97,10 @@ int QMC5883L::probe()
return PX4_OK;
}
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;

View File

@ -85,8 +85,6 @@ void VCM1193L::print_status()
int VCM1193L::probe()
{
_retries = 1;
for (int retry = 0; retry < 3; retry++) {
// first read 0x0 once
const uint8_t cmd = 0;
@ -99,6 +97,10 @@ int VCM1193L::probe()
return PX4_OK;
}
}
if (retry > 0) {
_retries = 1;
}
}
return PX4_ERROR;