mirror of https://github.com/ArduPilot/ardupilot
AP_Compass: use memcmp to check whoami result code from HMC5843 device
Co-authored-by: muramura <ma2maru@gmail.com>
This commit is contained in:
parent
77067edd91
commit
3e1ad5dab6
|
@ -334,9 +334,7 @@ bool AP_Compass_HMC5843::_check_whoami()
|
||||||
// can't talk on bus
|
// can't talk on bus
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (id[0] != 'H' ||
|
if (memcmp(id, "H43", 3) != 0) {
|
||||||
id[1] != '4' ||
|
|
||||||
id[2] != '3') {
|
|
||||||
// not a HMC5x83 device
|
// not a HMC5x83 device
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue