aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2019-02-03 11:25:22 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2019-02-03 11:25:22 +0000
commita730e76743ec6b641c5da9e3b8f81c40d629d87b (patch)
treec7c96813d5187d13a56ae7afe5681ab3f9acfdfc
parentd6b430bd91ebafccaf80a75daaa8524dcee2c91c (diff)
downloadChibiOS-a730e76743ec6b641c5da9e3b8f81c40d629d87b.tar.gz
ChibiOS-a730e76743ec6b641c5da9e3b8f81c40d629d87b.tar.bz2
ChibiOS-a730e76743ec6b641c5da9e3b8f81c40d629d87b.zip
Fixed Bux #1006
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_19.1.x@12635 110e8d01-0319-4d1e-a829-52ad28d1bb01
-rw-r--r--os/ex/ST/hts221.c14
-rw-r--r--os/ex/ST/hts221.h4
-rw-r--r--readme.txt4
3 files changed, 9 insertions, 13 deletions
diff --git a/os/ex/ST/hts221.c b/os/ex/ST/hts221.c
index 59a020926..92b518259 100644
--- a/os/ex/ST/hts221.c
+++ b/os/ex/ST/hts221.c
@@ -114,19 +114,10 @@ static msg_t hts221Calibrate(HTS221Driver *devp) {
uint8_t calib[16], H0_rH_x2, H1_rH_x2, msb;
int16_t H0_T0_OUT, H1_T0_OUT, T0_degC_x8, T1_degC_x8, T0_OUT, T1_OUT;
-#if HTS221_SHARED_I2C
- i2cAcquireBus(devp->config->i2cp);
- i2cStart(devp->config->i2cp, devp->config->i2ccfg);
-#endif /* HTS221_SHARED_I2C */
-
/* Retrieving rH values from Calibration registers */
msg = hts221I2CReadRegister(devp->config->i2cp,
HTS221_AD_CALIB_0, calib, 16);
-#if HTS221_SHARED_I2C
- i2cReleaseBus(devp->config->i2cp);
-#endif /* HTS221_SHARED_I2C */
-
H0_rH_x2 = calib[0];
H1_rH_x2 = calib[1];
H0_T0_OUT = calib[6];
@@ -666,13 +657,16 @@ void hts221Start(HTS221Driver *devp, const HTS221Config *config) {
i2cAcquireBus(devp->config->i2cp);
#endif /* HTS221_SHARED_I2C */
+ /* Intializing the I2C. */
i2cStart(devp->config->i2cp, devp->config->i2ccfg);
+
hts221Calibrate(devp);
#if HTS221_SHARED_I2C
- i2cReleaseBus(devp->config->i2cp);
+ i2cReleaseBus(devp->config->i2cp);
#endif /* HTS221_SHARED_I2C */
+
if(devp->config->hygrosensitivity == NULL) {
devp->hygrosensitivity = devp->hygrofactorysensitivity;
}
diff --git a/os/ex/ST/hts221.h b/os/ex/ST/hts221.h
index da2fa2d1d..37e88a2a0 100644
--- a/os/ex/ST/hts221.h
+++ b/os/ex/ST/hts221.h
@@ -44,7 +44,7 @@
/**
* @brief HTS221 driver version string.
*/
-#define EX_HTS221_VERSION "1.1.1"
+#define EX_HTS221_VERSION "1.1.2"
/**
* @brief HTS221 driver version major number.
@@ -59,7 +59,7 @@
/**
* @brief HTS221 driver version patch number.
*/
-#define EX_HTS221_PATCH 1
+#define EX_HTS221_PATCH 2
/** @} */
/**
diff --git a/readme.txt b/readme.txt
index 419e26820..1556869aa 100644
--- a/readme.txt
+++ b/readme.txt
@@ -75,7 +75,9 @@
*** 19.1.1 ***
- FIX: Fixed problem in STM32 mcuconf.h template files (bug #1007).
-- EX: Fixed missing I2C release bus in LPS22HB initialization (bug #1005).
+- EX: Fixed I2C Acquire bus called twice in the HTS221 initialization
+ (bug #1006).
+- EX: Fixed missing I2C release bus in LPS22HB initialization (bug #1005).
*** 19.1.0 ***
- First 19.1.x release, see release note 19.1.0.