mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
AP_InertialSensor: ADIS16607: drop dead store when draining FIFO
When discarding the rest of a FIFO block the read of REG_FIFO_DATA is only needed for its side effect (advancing the FIFO); the stored value was never used. Call it via UNUSED_RESULT() to make discarding the result explicit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
committed by
Peter Barker
co-authored by
Claude Opus 4.8
parent
8ca2d44597
commit
f426116a77
@@ -392,9 +392,9 @@ void AP_InertialSensor_ADIS16607::read_sensor_fifo(void)
|
||||
} else if (ch == ADIS16607_FIFO_CHANNEL_MAX_INDEX) {
|
||||
need_sync = false;
|
||||
} else {
|
||||
// Read to end of FIFO block
|
||||
// Read to end of FIFO block (data discarded; the read advances the FIFO)
|
||||
while (fifo_word_num != 0) {
|
||||
val = read_reg16(REG_FIFO_DATA);
|
||||
UNUSED_RESULT(read_reg16(REG_FIFO_DATA));
|
||||
ch = read_reg16(REG_FIFO_CH_INDEX);
|
||||
fifo_word_num--;
|
||||
if (ch == ADIS16607_FIFO_CHANNEL_MAX_INDEX) {
|
||||
|
||||
Reference in New Issue
Block a user