AP_Compass: removed assert calls
these waste flash space and do not do us any good
This commit is contained in:
parent
31b0682246
commit
0f5dd40052
@ -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 -
|
||||
* calling with any other value is a mistake
|
||||
*/
|
||||
assert(reg == REG_ST1);
|
||||
if (reg != REG_ST1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int n = _slave->read(buf);
|
||||
return n == static_cast<int>(size);
|
||||
|
@ -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 -
|
||||
* calling with any other value is a mistake
|
||||
*/
|
||||
assert(reg == AK8963_HXL);
|
||||
if (reg != AK8963_HXL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int n = _slave->read(buf);
|
||||
return n == static_cast<int>(size);
|
||||
|
@ -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 -
|
||||
* 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);
|
||||
return n == static_cast<int>(size);
|
||||
|
Loading…
Reference in New Issue
Block a user