Skip to content

Commit

Permalink
Simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
jabberrock committed Nov 21, 2024
1 parent 7004468 commit a6ce351
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sensors/softfusion/drivers/bmi270.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,8 @@ struct BMI270 {
}
getFromFifo<uint8_t>(i, read_buffer); // skip 1 byte
} else if ((header & Fifo::ModeMask) == Fifo::DataFrame) {
uint8_t gyro_data_length
= (header & Fifo::GyrDataBit) == Fifo::GyrDataBit ? 6 : 0;
uint8_t accel_data_length
= (header & Fifo::AccelDataBit) == Fifo::AccelDataBit ? 6 : 0;
uint8_t gyro_data_length = header & Fifo::GyrDataBit ? 6 : 0;
uint8_t accel_data_length = header & Fifo::AccelDataBit ? 6 : 0;
uint8_t required_length = gyro_data_length + accel_data_length;
if (i + required_length > bytes_to_read) {
// incomplete frame, will be re-read next time
Expand Down

0 comments on commit a6ce351

Please sign in to comment.