diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-13 01:34:49 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-13 01:34:49 +0200 |
commit | d84fe2913e40e91ce6d7530b438dbe18db49ec01 (patch) | |
tree | 22e1e77486615b8ec313c99dbcb42c221dcbae0d | |
parent | 6dd4069561983966c1d75766dbac3a43b23c777d (diff) | |
download | px4-firmware-d84fe2913e40e91ce6d7530b438dbe18db49ec01.tar.gz px4-firmware-d84fe2913e40e91ce6d7530b438dbe18db49ec01.tar.bz2 px4-firmware-d84fe2913e40e91ce6d7530b438dbe18db49ec01.zip |
Move IRQ restore to right position
-rw-r--r-- | src/drivers/lsm303d/lsm303d.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/lsm303d/lsm303d.cpp b/src/drivers/lsm303d/lsm303d.cpp index a90cd0a3d..0b0906d9e 100644 --- a/src/drivers/lsm303d/lsm303d.cpp +++ b/src/drivers/lsm303d/lsm303d.cpp @@ -532,6 +532,7 @@ LSM303D::reset() /* enable mag */ write_reg(ADDR_CTRL_REG7, REG7_CONT_MODE_M); write_reg(ADDR_CTRL_REG5, REG5_RES_HIGH_M); + irqrestore(flags); accel_set_range(LSM303D_ACCEL_DEFAULT_RANGE_G); accel_set_samplerate(LSM303D_ACCEL_DEFAULT_RATE); @@ -540,7 +541,6 @@ LSM303D::reset() mag_set_range(LSM303D_MAG_DEFAULT_RANGE_GA); mag_set_samplerate(LSM303D_MAG_DEFAULT_RATE); - irqrestore(flags); _accel_read = 0; _mag_read = 0; @@ -1013,6 +1013,7 @@ LSM303D::accel_set_range(unsigned max_g) _accel_range_scale = new_scale_g_digit * LSM303D_ONE_G; + modify_reg(ADDR_CTRL_REG2, clearbits, setbits); return OK; |