diff options
Diffstat (limited to 'os')
| -rw-r--r-- | os/ex/ST/lsm303dlhc.c | 9 | ||||
| -rw-r--r-- | os/ex/ST/lsm303dlhc.h | 20 | 
2 files changed, 19 insertions, 10 deletions
| diff --git a/os/ex/ST/lsm303dlhc.c b/os/ex/ST/lsm303dlhc.c index a86885b27..f538b559c 100644 --- a/os/ex/ST/lsm303dlhc.c +++ b/os/ex/ST/lsm303dlhc.c @@ -472,6 +472,12 @@ static msg_t acc_set_full_scale(void *ip, lsm303dlhc_acc_fs_t fs) {      scale = newfs / ((LSM303DLHCDriver *)ip)->accfullscale;
      ((LSM303DLHCDriver *)ip)->accfullscale = newfs;
 +#if LSM303DLHC_SHARED_I2C
 +		i2cAcquireBus(((LSM303DLHCDriver *)ip)->config->i2cp);
 +		i2cStart(((LSM303DLHCDriver *)ip)->config->i2cp,
 +						 ((LSM303DLHCDriver *)ip)->config->i2ccfg);
 +#endif /* LSM303DLHC_SHARED_I2C */
 +
      /* Updating register.*/
      msg = lsm303dlhcI2CReadRegister(((LSM303DLHCDriver *)ip)->config->i2cp,
                                     LSM303DLHC_SAD_ACC,
 @@ -486,6 +492,9 @@ static msg_t acc_set_full_scale(void *ip, lsm303dlhc_acc_fs_t fs) {                                      LSM303DLHC_SAD_ACC, buff, 1);
      if(msg != MSG_OK)
        return msg;
 +#if LSM303DLHC_SHARED_I2C
 +		i2cReleaseBus(((LSM303DLHCDriver *)ip)->config->i2cp);
 +#endif /* LSM303DLHC_SHARED_I2C */
      /* Scaling sensitivity and bias. Re-calibration is suggested anyway. */
      for(i = 0; i < LSM303DLHC_ACC_NUMBER_OF_AXES; i++) {
 diff --git a/os/ex/ST/lsm303dlhc.h b/os/ex/ST/lsm303dlhc.h index 470d8b77e..0fae07b50 100644 --- a/os/ex/ST/lsm303dlhc.h +++ b/os/ex/ST/lsm303dlhc.h @@ -41,7 +41,7 @@  /**
   * @brief   LSM303DLHC driver version string.
   */
 -#define EX_LSM303DLHC_VERSION       "1.0.0"
 +#define EX_LSM303DLHC_VERSION       "1.0.1"
  /**
   * @brief   LSM303DLHC driver version major number.
 @@ -56,7 +56,7 @@  /**
   * @brief   LSM303DLHC driver version patch number.
   */
 -#define EX_LSM303DLHC_PATCH         0
 +#define EX_LSM303DLHC_PATCH         1
  /** @} */
  /**
 @@ -176,14 +176,14 @@   * @{
   */
  #define LSM303DLHC_CTRL_REG1_A_MASK         0xFF
 -#define LSM303DLHC_CTRL_REG1_A_XEN         (1 << 0)
 -#define LSM303DLHC_CTRL_REG1_A_YEN         (1 << 1)
 -#define LSM303DLHC_CTRL_REG1_A_ZEN         (1 << 2)
 -#define LSM303DLHC_CTRL_REG1_A_LPEN        (1 << 3)
 -#define LSM303DLHC_CTRL_REG1_A_ODR0        (1 << 4)
 -#define LSM303DLHC_CTRL_REG1_A_ODR1        (1 << 5)
 -#define LSM303DLHC_CTRL_REG1_A_ODR2        (1 << 6)
 -#define LSM303DLHC_CTRL_REG1_A_ODR3        (1 << 7)
 +#define LSM303DLHC_CTRL_REG1_A_XEN          (1 << 0)
 +#define LSM303DLHC_CTRL_REG1_A_YEN          (1 << 1)
 +#define LSM303DLHC_CTRL_REG1_A_ZEN          (1 << 2)
 +#define LSM303DLHC_CTRL_REG1_A_LPEN         (1 << 3)
 +#define LSM303DLHC_CTRL_REG1_A_ODR0         (1 << 4)
 +#define LSM303DLHC_CTRL_REG1_A_ODR1         (1 << 5)
 +#define LSM303DLHC_CTRL_REG1_A_ODR2         (1 << 6)
 +#define LSM303DLHC_CTRL_REG1_A_ODR3         (1 << 7)
  /** @} */
  /**
 | 
