Skip to content

Commit

Permalink
AP_Compass: use memcmp to check whoami result code from HMC5843 device
Browse files Browse the repository at this point in the history
Co-authored-by: muramura <[email protected]>
  • Loading branch information
peterbarker and muramura committed Sep 22, 2024
1 parent 0020cf5 commit b9e06bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libraries/AP_Compass/AP_Compass_HMC5843.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ bool AP_Compass_HMC5843::_check_whoami()
// can't talk on bus
return false;
}
if (id[0] != 'H' ||
id[1] != '4' ||
id[2] != '3') {
if (memcmp(id, "H43", 3) != 0) {
// not a HMC5x83 device
return false;
}
Expand Down

0 comments on commit b9e06bb

Please sign in to comment.