diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-20 12:28:12 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-20 12:28:12 +0200 |
commit | 7dc595167391d00a4615cefb6d46990352147da1 (patch) | |
tree | b1fd44d1cfed8e97d4ec20d4ca8126d0d83ff97f | |
parent | 9e099b42fadffe466547512aed2edf26dafed8d4 (diff) | |
parent | 690843c53aa03283688e04fbe2894fc986f31b6b (diff) | |
download | px4-firmware-7dc595167391d00a4615cefb6d46990352147da1.tar.gz px4-firmware-7dc595167391d00a4615cefb6d46990352147da1.tar.bz2 px4-firmware-7dc595167391d00a4615cefb6d46990352147da1.zip |
Merge pull request #1295 from muharred/master
HMC5883 set_excitement minor fix.
-rw-r--r-- | src/drivers/hmc5883/hmc5883.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/drivers/hmc5883/hmc5883.cpp b/src/drivers/hmc5883/hmc5883.cpp index 0e9a961ac..e4ecfa6b5 100644 --- a/src/drivers/hmc5883/hmc5883.cpp +++ b/src/drivers/hmc5883/hmc5883.cpp @@ -1283,14 +1283,13 @@ int HMC5883::set_excitement(unsigned enable) if (OK != ret) perf_count(_comms_errors); + _conf_reg &= ~0x03; // reset previous excitement mode if (((int)enable) < 0) { _conf_reg |= 0x01; } else if (enable > 0) { _conf_reg |= 0x02; - } else { - _conf_reg &= ~0x03; } // ::printf("set_excitement enable=%d regA=0x%x\n", (int)enable, (unsigned)_conf_reg); |