AP_Compass: removed assert calls

these waste flash space and do not do us any good
This commit is contained in:
Andrew Tridgell 2021-03-25 12:48:59 +11:00
parent 31b0682246
commit 0f5dd40052
3 changed files with 9 additions and 3 deletions

View File

@ -391,7 +391,9 @@ bool AP_AK09916_BusDriver_Auxiliary::block_read(uint8_t reg, uint8_t *buf, uint3
* We can only read a block when reading the block of sample values - * We can only read a block when reading the block of sample values -
* calling with any other value is a mistake * calling with any other value is a mistake
*/ */
assert(reg == REG_ST1); if (reg != REG_ST1) {
return false;
}
int n = _slave->read(buf); int n = _slave->read(buf);
return n == static_cast<int>(size); return n == static_cast<int>(size);

View File

@ -328,7 +328,9 @@ bool AP_AK8963_BusDriver_Auxiliary::block_read(uint8_t reg, uint8_t *buf, uint32
* We can only read a block when reading the block of sample values - * We can only read a block when reading the block of sample values -
* calling with any other value is a mistake * calling with any other value is a mistake
*/ */
assert(reg == AK8963_HXL); if (reg != AK8963_HXL) {
return false;
}
int n = _slave->read(buf); int n = _slave->read(buf);
return n == static_cast<int>(size); return n == static_cast<int>(size);

View File

@ -521,7 +521,9 @@ bool AP_HMC5843_BusDriver_Auxiliary::block_read(uint8_t reg, uint8_t *buf, uint3
* We can only read a block when reading the block of sample values - * We can only read a block when reading the block of sample values -
* calling with any other value is a mistake * calling with any other value is a mistake
*/ */
assert(reg == HMC5843_REG_DATA_OUTPUT_X_MSB); if (reg != HMC5843_REG_DATA_OUTPUT_X_MSB) {
return false;
}
int n = _slave->read(buf); int n = _slave->read(buf);
return n == static_cast<int>(size); return n == static_cast<int>(size);