ldc1612: ignore amplitude errors during homing
Amplitude errors are useful but often too aggressive. On some sensors, it is not possible to avoid them completely. Make them non-critical for homing. Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
1 parent
f7ddb40037
commit
c6c7614972
1 file changed
+4
@@ -131,8 +131,12 @@ cancel_homing(struct ldc1612 *ld, int error_code)
|
||||
trsync_do_trigger(ld->ts, ld->error_reason + error_code);
|
||||
}
|
||||
|
||||
#define DATA_ERROR_AMPLITUDE (1L << 28)
|
||||
|
||||
static int
|
||||
check_data_bits(struct ldc1612 *ld, uint32_t raw_data) {
|
||||
// Ignore amplitude errors
|
||||
raw_data &= ~DATA_ERROR_AMPLITUDE;
|
||||
if (raw_data < 0x0fffffff)
|
||||
return 0;
|
||||
cancel_homing(ld, SE_SENSOR_ERROR);
|
||||
|
||||
Reference in new issue
Block a user