diff options
author | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-28 18:08:18 +0000 |
---|---|---|
committer | Rocco Marco Guglielmi <roccomarco.guglielmi@live.com> | 2016-09-28 18:08:18 +0000 |
commit | 73419a9adb4e53396ab43a815b581e0271432a04 (patch) | |
tree | 12fbb2978248a019a122f4833ae71c1753ba36f3 /os/ex | |
parent | 915c7e5362d720b7579ba41fbd81029ada9d7202 (diff) | |
download | ChibiOS-73419a9adb4e53396ab43a815b581e0271432a04.tar.gz ChibiOS-73419a9adb4e53396ab43a815b581e0271432a04.tar.bz2 ChibiOS-73419a9adb4e53396ab43a815b581e0271432a04.zip |
LIS3MDL minor fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9817 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/ex')
-rw-r--r-- | os/ex/ST/lis3mdl.c | 11 | ||||
-rw-r--r-- | os/ex/ST/lis3mdl.h | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/os/ex/ST/lis3mdl.c b/os/ex/ST/lis3mdl.c index 07640648c..e47ca146f 100644 --- a/os/ex/ST/lis3mdl.c +++ b/os/ex/ST/lis3mdl.c @@ -58,7 +58,8 @@ * @return the operation status.
* @notapi
*/
-msg_t lis3mdlI2CReadRegister(I2CDriver *i2cp, lis3mdl_sad_t sad, uint8_t reg, uint8_t* rxbuf, size_t n) {
+msg_t lis3mdlI2CReadRegister(I2CDriver *i2cp, lis3mdl_sad_t sad, uint8_t reg,
+ uint8_t* rxbuf, size_t n) {
uint8_t txbuf = reg;
if(n > 1)
txbuf |= LIS3MDL_SUB_MS;
@@ -101,7 +102,7 @@ static size_t get_axes_number(void *ip) { static msg_t read_raw(void *ip, int32_t axes[LIS3MDL_NUMBER_OF_AXES]) {
int16_t tmp;
- uint8_t i, buff[2 *LIS3MDL_NUMBER_OF_AXES];
+ uint8_t i, buff[2 * LIS3MDL_NUMBER_OF_AXES];
msg_t msg = MSG_OK;
osalDbgCheck((ip != NULL) && (axes != NULL));
@@ -262,7 +263,7 @@ static msg_t set_full_scale(void *ip, lis3mdl_fs_t fs) { ((LIS3MDLDriver *)ip)->config->slaveaddress,
LIS3MDL_AD_CTRL_REG2, &cr[1], 1);
#if LIS3MDL_SHARED_I2C
- i2cReleaseBus(((LIS3MDLDriver *)ip)->config->i2cp);
+ i2cReleaseBus(((LIS3MDLDriver *)ip)->config->i2cp);
#endif /* LIS3MDL_SHARED_I2C */
if(msg != MSG_OK)
return msg;
@@ -292,7 +293,7 @@ static msg_t set_full_scale(void *ip, lis3mdl_fs_t fs) { ((LIS3MDLDriver *)ip)->bias[i] *= scale;
}
}
- return MSG_OK;
+ return msg;
}
static const struct BaseSensorVMT vmt_basesensor = {
@@ -328,7 +329,7 @@ void lis3mdlObjectInit(LIS3MDLDriver *devp) { devp->vmt_lis3mdl = &vmt_lis3mdl;
devp->config = NULL;
for(i = 0; i < LIS3MDL_NUMBER_OF_AXES; i++)
- devp->bias[i] = 0;
+ devp->bias[i] = 0.0f;
devp->state = LIS3MDL_STOP;
}
diff --git a/os/ex/ST/lis3mdl.h b/os/ex/ST/lis3mdl.h index dc0ed5fa0..fbafc7fe2 100644 --- a/os/ex/ST/lis3mdl.h +++ b/os/ex/ST/lis3mdl.h @@ -40,7 +40,7 @@ /**
* @brief LIS3MDL driver version string.
*/
-#define EX_LIS3MDL_VERSION "1.0.2"
+#define EX_LIS3MDL_VERSION "1.0.3"
/**
* @brief LIS3MDL driver version major number.
@@ -55,7 +55,7 @@ /**
* @brief LIS3MDL driver version patch number.
*/
-#define EX_LIS3MDL_PATCH 2
+#define EX_LIS3MDL_PATCH 3
/** @} */
/**
|