Fixed vmt related code. Indent minor fixes.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9102 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
Rocco Marco Guglielmi 2016-03-14 16:43:47 +00:00
parent f04e169af8
commit 2cdf2e4fa8
4 changed files with 28 additions and 28 deletions

View File

@ -287,11 +287,11 @@ static msg_t calibrate(void *ip) {
return MSG_OK;
}
static const struct BaseSensorVMT vmtse = {
static const struct BaseSensorVMT vmt_basesensor = {
get_axes_number, read_raw, read_cooked
};
static const struct BaseGyroscopeVMT vmtgy = {
static const struct BaseGyroscopeVMT vmt_basegyroscope = {
get_axes_number, read_raw, read_cooked,
reset_calibration, calibrate
};
@ -311,9 +311,9 @@ static const struct BaseGyroscopeVMT vmtgy = {
void l3gd20ObjectInit(L3GD20Driver *devp) {
uint32_t i;
devp->vmtse = &vmtse;
devp->vmtgy = &vmtgy;
devp->vmt = (struct L3GD20VMT*) &vmtgy;
devp->vmt_basesensor = &vmt_basesensor;
devp->vmt_basegyroscope = &vmt_basegyroscope;
devp->vmt = (struct L3GD20VMT*) &vmt_basegyroscope;
devp->state = L3GD20_STOP;
devp->config = NULL;
for(i = 0; i < L3GD20_NUMBER_OF_AXES; i++)

View File

@ -279,9 +279,9 @@ struct L3GD20VMT {
*/
struct L3GD20Driver {
/** @brief Virtual Methods Table.*/
const struct BaseSensorVMT *vmtse;
const struct BaseSensorVMT *vmt_basesensor;
/** @brief Virtual Methods Table.*/
const struct BaseGyroscopeVMT *vmtgy;
const struct BaseGyroscopeVMT *vmt_basegyroscope;
/** @brief Virtual Methods Table.*/
const struct L3GD20VMT *vmt;
_l3gd20_data

View File

@ -338,7 +338,7 @@ static msg_t acc_read_cooked(void *ip, float axes[]) {
return msg;
}
static const struct LSM6DS0ACCVMT accvmt = {
static const struct LSM6DS0ACCVMT vmt_baseaccelerometer = {
acc_get_axes_number, acc_read_raw, acc_read_cooked
};
@ -355,7 +355,7 @@ static const struct LSM6DS0ACCVMT accvmt = {
*/
void lsm6ds0ObjectInit(LSM6DS0Driver *devp) {
devp->vmtac = &accvmt;
devp->vmt_baseaccelerometer = &vmt_baseaccelerometer;
devp->state = LSM6DS0_STOP;
devp->config = NULL;
}

View File

@ -100,10 +100,6 @@
/* Driver data structures and types. */
/*===========================================================================*/
/**
* @name LSM6DS0 data structures and types
* @{
*/
/**
* @name LSM6DS0 accelerometer subsystem data structures and types
* @{
@ -209,6 +205,7 @@ typedef enum {
LSM6DS0_ACC_UNIT_MG = 0x01, /**< Cooked data in mg. */
LSM6DS0_ACC_UNIT_SI = 0x02, /**< Cooked data in m/s^2. */
} lsm6ds0_acc_unit_t;
/**
* @brief LSM6DS0 accelerometer subsystem configuration structure.
*/
@ -260,7 +257,6 @@ typedef struct {
* @name LSM6DS0 gyroscope subsystem data structures and types
* @{
*/
/**
* @brief LSM6DS0 gyroscope subsystem full scale
*/
@ -384,6 +380,10 @@ typedef struct {
} LSM6DS0GyroConfig;
/** @} */
/**
* @name LSM6DS0 main system data structures and types
* @{
*/
/**
* @brief Accelerometer and Gyroscope Slave Address
*/
@ -525,9 +525,9 @@ struct LSM6DS0GYROVMT {
*/
struct LSM6DS0Driver {
/** @brief Accelerometer Virtual Methods Table.*/
const struct LSM6DS0ACCVMT *vmtac;
const struct LSM6DS0ACCVMT *vmt_baseaccelerometer;
/** @brief Gyroscope Virtual Methods Table.*/
const struct LSM6DS0GYROVMT *vmtgy;
const struct LSM6DS0GYROVMT *vmt_basegyroscope;
_lsm6ds0_data
};
/** @} */