mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Merge pull request #6 from skelly/l3gd20h_support
Added l3gd20h detection
This commit is contained in:
commit
758ebf6c04
@ -78,6 +78,7 @@ static const int ERROR = -1;
|
||||
|
||||
/* register addresses */
|
||||
#define ADDR_WHO_AM_I 0x0F
|
||||
#define WHO_I_AM_H 0xD7
|
||||
#define WHO_I_AM 0xD4
|
||||
|
||||
#define ADDR_CTRL_REG1 0x20
|
||||
@ -351,7 +352,7 @@ L3GD20::probe()
|
||||
(void)read_reg(ADDR_WHO_AM_I);
|
||||
|
||||
/* verify that the device is attached and functioning */
|
||||
if (read_reg(ADDR_WHO_AM_I) == WHO_I_AM)
|
||||
if (read_reg(ADDR_WHO_AM_I) == WHO_I_AM || read_reg(ADDR_WHO_AM_I) == WHO_I_AM_H)
|
||||
return OK;
|
||||
|
||||
return -EIO;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user