|
|
|
@ -296,6 +296,7 @@ HMC5883::init()
@@ -296,6 +296,7 @@ HMC5883::init()
|
|
|
|
|
|
|
|
|
|
/* do I2C init (and probe) first */ |
|
|
|
|
ret = I2C::init(); |
|
|
|
|
|
|
|
|
|
if (ret != OK) |
|
|
|
|
goto out; |
|
|
|
|
|
|
|
|
@ -617,6 +618,7 @@ HMC5883::measure()
@@ -617,6 +618,7 @@ HMC5883::measure()
|
|
|
|
|
* Send the command to begin a measurement. |
|
|
|
|
*/ |
|
|
|
|
ret = write_reg(ADDR_MODE, MODE_REG_SINGLE_MODE); |
|
|
|
|
|
|
|
|
|
if (OK != ret) |
|
|
|
|
_measure_errors++; |
|
|
|
|
|
|
|
|
@ -655,6 +657,7 @@ HMC5883::collect()
@@ -655,6 +657,7 @@ HMC5883::collect()
|
|
|
|
|
/* get measurements from the device */ |
|
|
|
|
cmd = ADDR_DATA_OUT_X_MSB; |
|
|
|
|
ret = transfer(&cmd, 1, (uint8_t *)&hmc_report, sizeof(hmc_report)); |
|
|
|
|
|
|
|
|
|
if (ret != OK) { |
|
|
|
|
debug("data/status read error"); |
|
|
|
|
goto out; |
|
|
|
|