mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
ist8310: do reset before WHOAMI call (#23161)
* ist8310: do reset before WHOAMI call Apparently, the IST8310's WHOAMI register is writeable. Presumably, this can get corrupted by bus noise. It is only reset if powered off for 30s. Therefore, we do a reset before doing the WHOAMI. * ist8310: improve comment Co-authored-by: Beat Küng <beat-kueng@gmx.net> --------- Co-authored-by: Beat Küng <beat-kueng@gmx.net>
This commit is contained in:
@@ -85,6 +85,15 @@ void IST8310::print_status()
|
||||
|
||||
int IST8310::probe()
|
||||
{
|
||||
// Apparently, the IST8310's WHOAMI register is writeable. Presumably,
|
||||
// this can get corrupted by bus noise. It is only reset if powered off
|
||||
// for 30s or by a reset.
|
||||
//
|
||||
// Therefore, we do a reset before doing the WHOAMI.
|
||||
RegisterWrite(Register::CNTL2, CNTL2_BIT::SRST);
|
||||
|
||||
px4_usleep(10000);
|
||||
|
||||
const uint8_t WAI = RegisterRead(Register::WAI);
|
||||
|
||||
if (WAI != Device_ID) {
|
||||
|
||||
Reference in New Issue
Block a user