Merge pull request #1295 from muharred/master

HMC5883 set_excitement minor fix.
This commit is contained in:
Lorenz Meier 2014-08-20 12:28:12 +02:00
commit 7dc5951673
1 changed files with 1 additions and 2 deletions

View File

@ -1283,14 +1283,13 @@ int HMC5883::set_excitement(unsigned enable)
if (OK != ret) if (OK != ret)
perf_count(_comms_errors); perf_count(_comms_errors);
_conf_reg &= ~0x03; // reset previous excitement mode
if (((int)enable) < 0) { if (((int)enable) < 0) {
_conf_reg |= 0x01; _conf_reg |= 0x01;
} else if (enable > 0) { } else if (enable > 0) {
_conf_reg |= 0x02; _conf_reg |= 0x02;
} else {
_conf_reg &= ~0x03;
} }
// ::printf("set_excitement enable=%d regA=0x%x\n", (int)enable, (unsigned)_conf_reg); // ::printf("set_excitement enable=%d regA=0x%x\n", (int)enable, (unsigned)_conf_reg);