Skip to content

Commit

Permalink
Update OTP Word LSB check
Browse files Browse the repository at this point in the history
  • Loading branch information
Viliuks committed Aug 9, 2024
1 parent 61ae571 commit 8a939f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/drivers/magnetometer/bosch/bmm350/BMM350.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,14 @@ int BMM350::ReadOTPWord(uint8_t addr, uint16_t *lsb_msb)
}
} while (!(otp_status & 0x01));

uint8_t msb, lsb;
uint8_t msb = 0, lsb = 0;
ret = RegisterRead(Register::OTP_DATA_MSB, &msb);

if (ret == PX4_OK) {
ret = RegisterRead(Register::OTP_DATA_LSB, &lsb);
*lsb_msb = ((msb << 8) | lsb) & 0xffff;
if(ret == PX4_OK){
*lsb_msb = ((msb << 8) | lsb) & 0xffff;
}
}
}

Expand Down

0 comments on commit 8a939f6

Please sign in to comment.