Added l3gd20h detection

This commit is contained in:
Sam Kelly 2013-06-13 12:51:50 -07:00
parent 9444def5f8
commit 53f29a25b6
1 changed files with 2 additions and 1 deletions

View File

@ -78,6 +78,7 @@ static const int ERROR = -1;
/* register addresses */ /* register addresses */
#define ADDR_WHO_AM_I 0x0F #define ADDR_WHO_AM_I 0x0F
#define WHO_I_AM_H 0xD7
#define WHO_I_AM 0xD4 #define WHO_I_AM 0xD4
#define ADDR_CTRL_REG1 0x20 #define ADDR_CTRL_REG1 0x20
@ -351,7 +352,7 @@ L3GD20::probe()
(void)read_reg(ADDR_WHO_AM_I); (void)read_reg(ADDR_WHO_AM_I);
/* verify that the device is attached and functioning */ /* 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 OK;
return -EIO; return -EIO;