diff options
Diffstat (limited to 'apps/drivers/hmc5883/hmc5883.cpp')
-rw-r--r-- | apps/drivers/hmc5883/hmc5883.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/drivers/hmc5883/hmc5883.cpp b/apps/drivers/hmc5883/hmc5883.cpp index a9212e7ab..c6d03a7e4 100644 --- a/apps/drivers/hmc5883/hmc5883.cpp +++ b/apps/drivers/hmc5883/hmc5883.cpp @@ -339,12 +339,14 @@ HMC5883::close_last(struct file *filp) int HMC5883::probe() { - uint8_t data[3]; + uint8_t data[3] = {0, 0, 0}; + _retries = 3; if (read_reg(ADDR_ID_A, data[0]) || read_reg(ADDR_ID_B, data[1]) || read_reg(ADDR_ID_C, data[2])) debug("read_reg fail"); + _retries = 1; if ((data[0] != ID_A_WHO_AM_I) || (data[1] != ID_B_WHO_AM_I) || |