diff options
author | px4dev <px4@purgatory.org> | 2012-08-22 22:26:09 -0700 |
---|---|---|
committer | px4dev <px4@purgatory.org> | 2012-08-22 22:26:09 -0700 |
commit | 92594ba76a3633aa1d70bbf822edb108dfa9cdec (patch) | |
tree | 0a8ba5208f2ef8bb295be4f1633936230593441b | |
parent | 0f74d08960753d8be7d04749c5c9b3153ed4813e (diff) | |
download | px4-firmware-92594ba76a3633aa1d70bbf822edb108dfa9cdec.tar.gz px4-firmware-92594ba76a3633aa1d70bbf822edb108dfa9cdec.tar.bz2 px4-firmware-92594ba76a3633aa1d70bbf822edb108dfa9cdec.zip |
Hack bus reset support into the old-style hmc5883 driver.
-rw-r--r-- | nuttx/configs/px4fmu/src/drv_hmc5833l.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nuttx/configs/px4fmu/src/drv_hmc5833l.c b/nuttx/configs/px4fmu/src/drv_hmc5833l.c index df6e26d4b..d51d654f7 100644 --- a/nuttx/configs/px4fmu/src/drv_hmc5833l.c +++ b/nuttx/configs/px4fmu/src/drv_hmc5833l.c @@ -323,13 +323,20 @@ hmc5883l_ioctl(struct file *filp, int cmd, unsigned long arg) return result; } +extern int up_i2creset(FAR struct i2c_dev_s * dev); + int hmc5883l_reset() { int ret; +#if 1 + ret = up_i2creset(hmc5883l_dev.i2c); + printf("HMC5883: BUS RESET %s\n", ret ? "FAIL" : "OK"); +#else printf("[hmc5883l drv] Resettet I2C2 BUS\n"); up_i2cuninitialize(hmc5883l_dev.i2c); hmc5883l_dev.i2c = up_i2cinitialize(2); I2C_SETFREQUENCY(hmc5883l_dev.i2c, 400000); +#endif return ret; } |