aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2018-02-27 20:41:45 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@gmail.com>2018-02-27 20:41:45 +0000
commite9f249bc21d5f5711464a53d0183f97a2e601180 (patch)
tree2829a06f90cf4cb827638074634e05989ca3709c /os
parent8ac0bdb4c892eb7d228059778712dc816f566327 (diff)
downloadChibiOS-e9f249bc21d5f5711464a53d0183f97a2e601180.tar.gz
ChibiOS-e9f249bc21d5f5711464a53d0183f97a2e601180.tar.bz2
ChibiOS-e9f249bc21d5f5711464a53d0183f97a2e601180.zip
Improved LSM303DLHC driver. Modified base demo
git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11589 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os')
-rw-r--r--os/ex/ST/lsm303dlhc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/os/ex/ST/lsm303dlhc.c b/os/ex/ST/lsm303dlhc.c
index da2387f81..f172063c3 100644
--- a/os/ex/ST/lsm303dlhc.c
+++ b/os/ex/ST/lsm303dlhc.c
@@ -132,7 +132,7 @@ static msg_t acc_read_raw(void *ip, int32_t axes[]) {
osalDbgCheck((ip != NULL) && (axes != NULL));
/* Getting parent instance pointer.*/
- devp = objGetInstance(LSM303DLHCDriver*, (BaseCompass*)ip);
+ devp = objGetInstance(LSM303DLHCDriver*, (BaseAccelerometer*)ip);
osalDbgAssert((devp->state == LSM303DLHC_READY),
"acc_read_raw(), invalid state");
@@ -827,13 +827,13 @@ static const struct LSM303DLHCVMT vmt_device = {
};
static const struct BaseAccelerometerVMT vmt_accelerometer = {
- sizeof(struct LSM303DLHCVMT),
+ sizeof(struct LSM303DLHCVMT*),
acc_get_axes_number, acc_read_raw, acc_read_cooked,
acc_set_bias, acc_reset_bias, acc_set_sensivity, acc_reset_sensivity
};
static const struct BaseCompassVMT vmt_compass = {
- sizeof(BaseAccelerometer),
+ sizeof(struct LSM303DLHCVMT*) + sizeof(BaseAccelerometer),
comp_get_axes_number, comp_read_raw, comp_read_cooked,
comp_set_bias, comp_reset_bias, comp_set_sensivity, comp_reset_sensivity
};