Minor fixes
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11687 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
d4c4f24cff
commit
99b89a4a02
|
@ -833,7 +833,7 @@ static const struct BaseAccelerometerVMT vmt_accelerometer = {
|
|||
};
|
||||
|
||||
static const struct BaseCompassVMT vmt_compass = {
|
||||
sizeof(struct LSM303DLHCVMT*) + 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
|
||||
};
|
||||
|
@ -850,8 +850,6 @@ static const struct BaseCompassVMT vmt_compass = {
|
|||
* @init
|
||||
*/
|
||||
void lsm303dlhcObjectInit(LSM303DLHCDriver *devp) {
|
||||
uint32_t i;
|
||||
|
||||
devp->vmt = &vmt_device;
|
||||
devp->acc_if.vmt = &vmt_accelerometer;
|
||||
devp->comp_if.vmt = &vmt_compass;
|
||||
|
@ -861,7 +859,6 @@ void lsm303dlhcObjectInit(LSM303DLHCDriver *devp) {
|
|||
devp->accaxes = LSM303DLHC_ACC_NUMBER_OF_AXES;
|
||||
devp->compaxes = LSM303DLHC_COMP_NUMBER_OF_AXES;
|
||||
|
||||
|
||||
devp->state = LSM303DLHC_STOP;
|
||||
}
|
||||
|
||||
|
@ -880,7 +877,7 @@ void lsm303dlhcStart(LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) {
|
|||
|
||||
osalDbgAssert((devp->state == LSM303DLHC_STOP) ||
|
||||
(devp->state == LSM303DLHC_READY),
|
||||
"lsm303dlhcStart(), invalid state");
|
||||
"lsm303dlhcStart(), invalid state");
|
||||
|
||||
devp->config = config;
|
||||
|
||||
|
@ -977,7 +974,6 @@ void lsm303dlhcStart(LSM303DLHCDriver *devp, const LSM303DLHCConfig *config) {
|
|||
for(i = 0; i < LSM303DLHC_ACC_NUMBER_OF_AXES; i++)
|
||||
devp->accbias[i] = LSM303DLHC_ACC_BIAS;
|
||||
|
||||
|
||||
/* Configuring Compass subsystem */
|
||||
/* Multiple write starting address.*/
|
||||
cr[0] = LSM303DLHC_AD_COMP_CRA_REG;
|
||||
|
|
|
@ -311,7 +311,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(LSM303DLHC_ACC_USE_ADVANCED) || defined(__DOXYGEN__)
|
||||
#define LSM303DLHC_ACC_USE_ADVANCED FALSE
|
||||
#define LSM303DLHC_ACC_USE_ADVANCED FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -321,7 +321,7 @@
|
|||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(LSM303DLHC_COMP_USE_ADVANCED) || defined(__DOXYGEN__)
|
||||
#define LSM303DLHC_COMP_USE_ADVANCED FALSE
|
||||
#define LSM303DLHC_COMP_USE_ADVANCED FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -331,7 +331,7 @@
|
|||
* @note The default is @p FALSE. Requires I2C_USE_MUTUAL_EXCLUSION.
|
||||
*/
|
||||
#if !defined(LSM303DLHC_SHARED_I2C) || defined(__DOXYGEN__)
|
||||
#define LSM303DLHC_SHARED_I2C FALSE
|
||||
#define LSM303DLHC_SHARED_I2C FALSE
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
|
@ -364,9 +364,9 @@ typedef struct LSM303DLHCDriver LSM303DLHCDriver;
|
|||
* @brief LSM303DLHC accelerometer subsystem full scale.
|
||||
*/
|
||||
typedef enum {
|
||||
LSM303DLHC_ACC_FS_2G = 0x00, /**< Full scale ±2g. */
|
||||
LSM303DLHC_ACC_FS_4G = 0x10, /**< Full scale ±4g. */
|
||||
LSM303DLHC_ACC_FS_8G = 0x20, /**< Full scale ±8g. */
|
||||
LSM303DLHC_ACC_FS_2G = 0x00, /**< Full scale ±2g. */
|
||||
LSM303DLHC_ACC_FS_4G = 0x10, /**< Full scale ±4g. */
|
||||
LSM303DLHC_ACC_FS_8G = 0x20, /**< Full scale ±8g. */
|
||||
LSM303DLHC_ACC_FS_16G = 0x30 /**< Full scale ±16g. */
|
||||
} lsm303dlhc_acc_fs_t;
|
||||
|
||||
|
@ -495,12 +495,11 @@ typedef struct {
|
|||
*/
|
||||
I2CDriver *i2cp;
|
||||
/**
|
||||
* @brief I2C configuration associated to this LSM303DLHC accelerometer
|
||||
* subsystem.
|
||||
* @brief I2C configuration associated to this LSM303DLHC.
|
||||
*/
|
||||
const I2CConfig *i2ccfg;
|
||||
/**
|
||||
* @brief LSM303DLHC initial sensitivity.
|
||||
* @brief LSM303DLHC accelerometer subsystem initial sensitivity.
|
||||
*/
|
||||
float *accsensitivity;
|
||||
/**
|
||||
|
@ -561,10 +560,10 @@ typedef struct {
|
|||
* @brief @p LSM303DLHC specific methods.
|
||||
*/
|
||||
#define _lsm303dlhc_methods_alone \
|
||||
/* Change full scale value of LSM303DLHC accelerometer subsystem .*/ \
|
||||
/* Change full scale value of LSM303DLHC accelerometer subsystem.*/ \
|
||||
msg_t (*acc_set_full_scale)(LSM303DLHCDriver *instance, \
|
||||
lsm303dlhc_acc_fs_t fs); \
|
||||
/* Change full scale value of LSM303DLHC compass subsystem .*/ \
|
||||
/* Change full scale value of LSM303DLHC compass subsystem.*/ \
|
||||
msg_t (*comp_set_full_scale)(LSM303DLHCDriver *instance, \
|
||||
lsm303dlhc_comp_fs_t fs); \
|
||||
|
||||
|
|
Loading…
Reference in New Issue