summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2018-09-08 00:06:09 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 06:13:47 -0700
commitc4a842a78c778e7c15cd3f78ae354e4d21a85ae9 (patch)
tree6668b4fd3911769f0011b5b17512d66923eea5fc
parente6344f8560bad936573be75f6b2810373c2cdb01 (diff)
downloadchrome-ec-c4a842a78c778e7c15cd3f78ae354e4d21a85ae9.tar.gz
type: Rename vector_3_t to intv3_t.
Naming of many vector types and matrix types are not clear enough. For example, we have: vector_3_t, which is a vector of three int. vec3_t, which is a vector of three float. size4_t, which is a vector of four size_t. mat33_t, which is a 3x3 matrix of float. matrix_3x3_t, which is a 3x3 matrix of fixed point. Besides, we have types like int8_t, uint16_t types. To clearly distinguished types, the CL propose to, For vector types, naming should be `$type + 'v' + $num + '_t'`: vector_3_t becomes intv3_t vec3_t becomes floatv3_t vector 4 of uint16_t becomes uint16v4_t (which doesn't exist yet) For matrix types, naming should be `mat$N$N_` + $type + '_t', where $N is the matrix size: matrix_3x3_t becomes mat33_fp_t # fp: fixed point mat33_t becomes mat33_float_t TEST=make buildall -j BUG=b:114662791 Change-Id: I865aa3ecbab6cb97f8585a081a679adf00febe1d Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215442 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--common/mag_cal.c2
-rw-r--r--common/math_util.c12
-rw-r--r--common/motion_lid.c12
-rw-r--r--common/motion_sense.c8
-rw-r--r--driver/accel_bma2x2.c2
-rw-r--r--driver/accel_kionix.c2
-rw-r--r--driver/accel_lis2dh.c2
-rw-r--r--driver/accelgyro_bmi160.c8
-rw-r--r--driver/accelgyro_lsm6ds0.c2
-rw-r--r--driver/accelgyro_lsm6dsm.c2
-rw-r--r--driver/als_bh1730.c2
-rw-r--r--driver/als_opt3001.c2
-rw-r--r--driver/als_si114x.c2
-rw-r--r--driver/baro_bmp280.c2
-rw-r--r--driver/gyro_l3gd20h.c2
-rw-r--r--driver/mag_bmm150.c16
-rw-r--r--driver/mag_bmm150.h6
-rw-r--r--driver/stm_mems_common.c2
-rw-r--r--driver/stm_mems_common.h2
-rw-r--r--driver/sync.c2
-rw-r--r--include/accelgyro.h2
-rw-r--r--include/mag_cal.h4
-rw-r--r--include/math_util.h8
-rw-r--r--include/motion_lid.h2
-rw-r--r--include/motion_sense.h6
-rw-r--r--test/math_util.c4
-rw-r--r--test/motion_lid.c2
27 files changed, 59 insertions, 59 deletions
diff --git a/common/mag_cal.c b/common/mag_cal.c
index 3ac2a7bcea..dab2b64d96 100644
--- a/common/mag_cal.c
+++ b/common/mag_cal.c
@@ -147,7 +147,7 @@ void init_mag_cal(struct mag_cal_t *moc)
moc->nsamples = 0;
}
-int mag_cal_update(struct mag_cal_t *moc, const vector_3_t v)
+int mag_cal_update(struct mag_cal_t *moc, const intv3_t v)
{
int new_bias = 0;
diff --git a/common/math_util.c b/common/math_util.c
index 6a49dc31c3..4cdddb1eab 100644
--- a/common/math_util.c
+++ b/common/math_util.c
@@ -126,7 +126,7 @@ static int int_sqrtf(fp_inter_t x)
}
#endif
-int vector_magnitude(const vector_3_t v)
+int vector_magnitude(const intv3_t v)
{
fp_inter_t sum = (fp_inter_t)v[0] * v[0] +
(fp_inter_t)v[1] * v[1] +
@@ -135,7 +135,7 @@ int vector_magnitude(const vector_3_t v)
return int_sqrtf(sum);
}
-fp_t cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2)
+fp_t cosine_of_angle_diff(const intv3_t v1, const intv3_t v2)
{
fp_inter_t dotproduct;
fp_inter_t denominator;
@@ -176,13 +176,13 @@ fp_t cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2)
* rotate a vector v
* - support input v and output res are the same vector
*/
-void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res)
+void rotate(const intv3_t v, const matrix_3x3_t R, intv3_t res)
{
fp_inter_t t[3];
if (R == NULL) {
if (v != res)
- memcpy(res, v, sizeof(vector_3_t));
+ memcpy(res, v, sizeof(intv3_t));
return;
}
@@ -204,14 +204,14 @@ void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res)
res[2] = FP_TO_INT(t[2]);
}
-void rotate_inv(const vector_3_t v, const matrix_3x3_t R, vector_3_t res)
+void rotate_inv(const intv3_t v, const matrix_3x3_t R, intv3_t res)
{
fp_inter_t t[3];
fp_t deter;
if (R == NULL) {
if (v != res)
- memcpy(res, v, sizeof(vector_3_t));
+ memcpy(res, v, sizeof(intv3_t));
return;
}
diff --git a/common/motion_lid.c b/common/motion_lid.c
index 27213d2c7a..cc7b098339 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -213,17 +213,17 @@ static int motion_lid_set_tablet_mode(int reliable)
*
* @return flag representing if resulting lid angle calculation is reliable.
*/
-static int calculate_lid_angle(const vector_3_t base, const vector_3_t lid,
+static int calculate_lid_angle(const intv3_t base, const intv3_t lid,
int *lid_angle)
{
- vector_3_t v;
+ intv3_t v;
fp_t lid_to_base_fp, cos_lid_90, cos_lid_270;
fp_t lid_to_base, base_to_hinge;
fp_t denominator;
int reliable = 1;
int base_magnitude2, lid_magnitude2;
int base_range, lid_range, i;
- vector_3_t scaled_base, scaled_lid;
+ intv3_t scaled_base, scaled_lid;
/*
* The angle between lid and base is:
@@ -422,9 +422,9 @@ void motion_lid_calc(void)
* because calculate_lid_angle assumes when the lid is closed, that
* the lid and base accelerometer data matches
*/
- vector_3_t lid = { accel_lid->xyz[X],
- accel_lid->xyz[Y] * -1,
- accel_lid->xyz[Z] * -1};
+ intv3_t lid = { accel_lid->xyz[X],
+ accel_lid->xyz[Y] * -1,
+ accel_lid->xyz[Z] * -1};
/* Calculate angle of lid accel. */
lid_angle_is_reliable = calculate_lid_angle(
accel_base->xyz, lid,
diff --git a/common/motion_sense.c b/common/motion_sense.c
index 966c2da99e..8e1fe4e35b 100644
--- a/common/motion_sense.c
+++ b/common/motion_sense.c
@@ -37,7 +37,7 @@
* Orientation mode vectors, must match sequential ordering of
* known orientations from enum motionsensor_orientation
*/
-const vector_3_t orientation_modes[] = {
+const intv3_t orientation_modes[] = {
[MOTIONSENSE_ORIENTATION_LANDSCAPE] = { 0, -1, 0 },
[MOTIONSENSE_ORIENTATION_PORTRAIT] = { 1, 0, 0 },
[MOTIONSENSE_ORIENTATION_UPSIDE_DOWN_PORTRAIT] = { -1, 0, 0 },
@@ -780,8 +780,8 @@ enum motionsensor_orientation motion_sense_remap_orientation(
enum motionsensor_orientation orientation)
{
enum motionsensor_orientation rotated_orientation;
- const vector_3_t *orientation_v;
- vector_3_t rotated_orientation_v;
+ const intv3_t *orientation_v;
+ intv3_t rotated_orientation_v;
if (orientation == MOTIONSENSE_ORIENTATION_UNKNOWN)
return MOTIONSENSE_ORIENTATION_UNKNOWN;
@@ -1646,7 +1646,7 @@ static int command_accel_read_xyz(int argc, char **argv)
char *e;
int id, n = 1, ret;
struct motion_sensor_t *sensor;
- vector_3_t v;
+ intv3_t v;
if (argc < 2)
return EC_ERROR_PARAM_COUNT;
diff --git a/driver/accel_bma2x2.c b/driver/accel_bma2x2.c
index 48e38fc14d..c1e9eb4d63 100644
--- a/driver/accel_bma2x2.c
+++ b/driver/accel_bma2x2.c
@@ -153,7 +153,7 @@ static int get_offset(const struct motion_sensor_t *s, int16_t *offset,
return EC_SUCCESS;
}
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t acc[6];
int ret, i;
diff --git a/driver/accel_kionix.c b/driver/accel_kionix.c
index 8e6984ad79..d486d4bcd5 100644
--- a/driver/accel_kionix.c
+++ b/driver/accel_kionix.c
@@ -449,7 +449,7 @@ static int check_orientation_locked(const struct motion_sensor_t *s)
}
#endif
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t acc[6];
uint8_t reg;
diff --git a/driver/accel_lis2dh.c b/driver/accel_lis2dh.c
index df0b7be7de..5f9b1b86b5 100644
--- a/driver/accel_lis2dh.c
+++ b/driver/accel_lis2dh.c
@@ -130,7 +130,7 @@ static int is_data_ready(const struct motion_sensor_t *s, int *ready)
return EC_SUCCESS;
}
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t raw[OUT_XYZ_SIZE];
int ret, tmp = 0;
diff --git a/driver/accelgyro_bmi160.c b/driver/accelgyro_bmi160.c
index 084304af54..8966d57261 100644
--- a/driver/accelgyro_bmi160.c
+++ b/driver/accelgyro_bmi160.c
@@ -475,7 +475,7 @@ static int get_offset(const struct motion_sensor_t *s,
int16_t *temp)
{
int i, val, val98;
- vector_3_t v;
+ intv3_t v;
switch (s->type) {
case MOTIONSENSE_TYPE_ACCEL:
@@ -535,7 +535,7 @@ static int set_offset(const struct motion_sensor_t *s,
int16_t temp)
{
int ret, i, val, val98;
- vector_3_t v = { offset[X], offset[Y], offset[Z] };
+ intv3_t v = { offset[X], offset[Y], offset[Z] };
rotate_inv(v, *s->rot_standard_ref, v);
@@ -647,7 +647,7 @@ end_perform_calib:
return ret;
}
-void normalize(const struct motion_sensor_t *s, vector_3_t v, uint8_t *data)
+void normalize(const struct motion_sensor_t *s, intv3_t v, uint8_t *data)
{
#ifdef CONFIG_MAG_BMI160_BMM150
if (s->type == MOTIONSENSE_TYPE_MAG)
@@ -1120,7 +1120,7 @@ static int irq_handler(struct motion_sensor_t *s, uint32_t *event)
#endif /* CONFIG_ACCEL_INTERRUPTS */
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t data[6];
int ret, status = 0;
diff --git a/driver/accelgyro_lsm6ds0.c b/driver/accelgyro_lsm6ds0.c
index 04cb7a7e78..b48e84dc0d 100644
--- a/driver/accelgyro_lsm6ds0.c
+++ b/driver/accelgyro_lsm6ds0.c
@@ -318,7 +318,7 @@ static int is_data_ready(const struct motion_sensor_t *s, int *ready)
return EC_SUCCESS;
}
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t raw[6];
uint8_t xyz_reg;
diff --git a/driver/accelgyro_lsm6dsm.c b/driver/accelgyro_lsm6dsm.c
index 45c76e8068..c4afa2a5e6 100644
--- a/driver/accelgyro_lsm6dsm.c
+++ b/driver/accelgyro_lsm6dsm.c
@@ -491,7 +491,7 @@ static int is_data_ready(const struct motion_sensor_t *s, int *ready)
* and collect the FIFO, even if it has one item: we don't have to check if the
* sensor is ready (minimize I2C access).
*/
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t raw[OUT_XYZ_SIZE];
uint8_t xyz_reg;
diff --git a/driver/als_bh1730.c b/driver/als_bh1730.c
index 57db6fdba7..0f96680471 100644
--- a/driver/als_bh1730.c
+++ b/driver/als_bh1730.c
@@ -55,7 +55,7 @@ static int bh1730_convert_to_lux(uint32_t data0_1)
/**
* Read BH1730 light sensor data.
*/
-static int bh1730_read_lux(const struct motion_sensor_t *s, vector_3_t v)
+static int bh1730_read_lux(const struct motion_sensor_t *s, intv3_t v)
{
struct bh1730_drv_data_t *drv_data = BH1730_GET_DATA(s);
int ret;
diff --git a/driver/als_opt3001.c b/driver/als_opt3001.c
index af6d07b06d..fd5dded45d 100644
--- a/driver/als_opt3001.c
+++ b/driver/als_opt3001.c
@@ -134,7 +134,7 @@ static int opt3001_i2c_write(const int port, const int addr, const int reg,
/**
* Read OPT3001 light sensor data.
*/
-int opt3001_read_lux(const struct motion_sensor_t *s, vector_3_t v)
+int opt3001_read_lux(const struct motion_sensor_t *s, intv3_t v)
{
struct opt3001_drv_data_t *drv_data = OPT3001_GET_DATA(s);
int ret;
diff --git a/driver/als_si114x.c b/driver/als_si114x.c
index 567caa917c..17f178080f 100644
--- a/driver/als_si114x.c
+++ b/driver/als_si114x.c
@@ -242,7 +242,7 @@ static int irq_handler(struct motion_sensor_t *s, uint32_t *event)
}
/* Just trigger a measurement */
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
int ret = 0;
uint8_t cmd;
diff --git a/driver/baro_bmp280.c b/driver/baro_bmp280.c
index e6220c7e35..b622535819 100644
--- a/driver/baro_bmp280.c
+++ b/driver/baro_bmp280.c
@@ -298,7 +298,7 @@ static int bmp280_init(const struct motion_sensor_t *s)
return sensor_init_done(s);
}
-static int bmp280_read(const struct motion_sensor_t *s, vector_3_t v)
+static int bmp280_read(const struct motion_sensor_t *s, intv3_t v)
{
int ret, pres;
struct bmp280_drv_data_t *data = BMP280_GET_DATA(s);
diff --git a/driver/gyro_l3gd20h.c b/driver/gyro_l3gd20h.c
index 0a70d0b36a..2afe948f27 100644
--- a/driver/gyro_l3gd20h.c
+++ b/driver/gyro_l3gd20h.c
@@ -310,7 +310,7 @@ static int is_data_ready(const struct motion_sensor_t *s, int *ready)
return EC_SUCCESS;
}
-static int read(const struct motion_sensor_t *s, vector_3_t v)
+static int read(const struct motion_sensor_t *s, intv3_t v)
{
uint8_t raw[6];
uint8_t xyz_reg;
diff --git a/driver/mag_bmm150.c b/driver/mag_bmm150.c
index 014909b365..cb53641c00 100644
--- a/driver/mag_bmm150.c
+++ b/driver/mag_bmm150.c
@@ -140,8 +140,8 @@ int bmm150_init(const struct motion_sensor_t *s)
}
void bmm150_temp_compensate_xy(const struct motion_sensor_t *s,
- vector_3_t raw,
- vector_3_t comp,
+ intv3_t raw,
+ intv3_t comp,
int r)
{
int inter, axis;
@@ -179,8 +179,8 @@ void bmm150_temp_compensate_xy(const struct motion_sensor_t *s,
}
void bmm150_temp_compensate_z(const struct motion_sensor_t *s,
- vector_3_t raw,
- vector_3_t comp,
+ intv3_t raw,
+ intv3_t comp,
int r)
{
int dividend, divisor;
@@ -209,11 +209,11 @@ void bmm150_temp_compensate_z(const struct motion_sensor_t *s,
}
void bmm150_normalize(const struct motion_sensor_t *s,
- vector_3_t v,
+ intv3_t v,
uint8_t *data)
{
uint16_t r;
- vector_3_t raw;
+ intv3_t raw;
struct mag_cal_t *cal = BMM150_CAL(s);
/* X and Y are two's complement 13 bits vectors */
@@ -235,7 +235,7 @@ void bmm150_normalize(const struct motion_sensor_t *s,
}
int bmm150_set_offset(const struct motion_sensor_t *s,
- const vector_3_t offset)
+ const intv3_t offset)
{
struct mag_cal_t *cal = BMM150_CAL(s);
cal->bias[X] = offset[X];
@@ -245,7 +245,7 @@ int bmm150_set_offset(const struct motion_sensor_t *s,
}
int bmm150_get_offset(const struct motion_sensor_t *s,
- vector_3_t offset)
+ intv3_t offset)
{
struct mag_cal_t *cal = BMM150_CAL(s);
offset[X] = cal->bias[X];
diff --git a/driver/mag_bmm150.h b/driver/mag_bmm150.h
index d3c07db11b..8824872977 100644
--- a/driver/mag_bmm150.h
+++ b/driver/mag_bmm150.h
@@ -118,13 +118,13 @@ int bmm150_init(const struct motion_sensor_t *s);
/* Command to normalize and apply temperature compensation */
void bmm150_normalize(const struct motion_sensor_t *s,
- vector_3_t v,
+ intv3_t v,
uint8_t *data);
int bmm150_set_offset(const struct motion_sensor_t *s,
- const vector_3_t offset);
+ const intv3_t offset);
int bmm150_get_offset(const struct motion_sensor_t *s,
- vector_3_t offset);
+ intv3_t offset);
#endif /* __CROS_EC_MAG_BMM150_H */
diff --git a/driver/stm_mems_common.c b/driver/stm_mems_common.c
index c22f0d42e5..00784fc1fc 100644
--- a/driver/stm_mems_common.c
+++ b/driver/stm_mems_common.c
@@ -117,7 +117,7 @@ int st_get_data_rate(const struct motion_sensor_t *s)
* @v: output vector
* @data: LSB raw data
*/
-void st_normalize(const struct motion_sensor_t *s, vector_3_t v, uint8_t *data)
+void st_normalize(const struct motion_sensor_t *s, intv3_t v, uint8_t *data)
{
int i, range;
struct stprivate_data *drvdata = s->drv_data;
diff --git a/driver/stm_mems_common.h b/driver/stm_mems_common.h
index 147b9f3e82..e2211480aa 100644
--- a/driver/stm_mems_common.h
+++ b/driver/stm_mems_common.h
@@ -109,7 +109,7 @@ int st_get_data_rate(const struct motion_sensor_t *s);
* @v: vector
* @data: LSB raw data
*/
-void st_normalize(const struct motion_sensor_t *s, vector_3_t v, uint8_t *data);
+void st_normalize(const struct motion_sensor_t *s, intv3_t v, uint8_t *data);
/* Internal data structure for sensors */
struct stprivate_data {
diff --git a/driver/sync.c b/driver/sync.c
index 0993aff402..6f994eabb2 100644
--- a/driver/sync.c
+++ b/driver/sync.c
@@ -40,7 +40,7 @@ struct ec_response_motion_sensor_data vector =
{.flags = MOTIONSENSE_SENSOR_FLAG_WAKEUP, .data = {0, 0, 0} };
int sync_enabled;
-static int sync_read(const struct motion_sensor_t *s, vector_3_t v)
+static int sync_read(const struct motion_sensor_t *s, intv3_t v)
{
v[0] = next_event.counter;
return EC_SUCCESS;
diff --git a/include/accelgyro.h b/include/accelgyro.h
index ea7b3efa6c..b2ea962ba2 100644
--- a/include/accelgyro.h
+++ b/include/accelgyro.h
@@ -30,7 +30,7 @@ struct accelgyro_drv {
* @v Vector to store acceleration (in units of counts).
* @return EC_SUCCESS if successful, non-zero if error.
*/
- int (*read)(const struct motion_sensor_t *s, vector_3_t v);
+ int (*read)(const struct motion_sensor_t *s, intv3_t v);
/**
* Setter and getter methods for the sensor range. The sensor range
diff --git a/include/mag_cal.h b/include/mag_cal.h
index 76410a193e..e0d6048be1 100644
--- a/include/mag_cal.h
+++ b/include/mag_cal.h
@@ -33,7 +33,7 @@ struct mag_cal_t {
vec4_t acc_w;
float radius;
- vector_3_t bias;
+ intv3_t bias;
/* number of samples needed to calibrate */
uint16_t batch_size;
@@ -42,5 +42,5 @@ struct mag_cal_t {
void init_mag_cal(struct mag_cal_t *moc);
-int mag_cal_update(struct mag_cal_t *moc, const vector_3_t v);
+int mag_cal_update(struct mag_cal_t *moc, const intv3_t v);
#endif /* __CROS_EC_MAG_CAL_H */
diff --git a/include/math_util.h b/include/math_util.h
index 093c6c099e..d94084f30d 100644
--- a/include/math_util.h
+++ b/include/math_util.h
@@ -99,7 +99,7 @@ static inline fp_t fp_abs(fp_t a)
typedef fp_t matrix_3x3_t[3][3];
/* Integer vector */
-typedef int vector_3_t[3];
+typedef int intv3_t[3];
/* For vectors, define which coordinates are in which location. */
enum {
@@ -132,7 +132,7 @@ fp_t arc_cos(fp_t x);
*
* @return Cosine of the angle between v1 and v2.
*/
-fp_t cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2);
+fp_t cosine_of_angle_diff(const intv3_t v1, const intv3_t v2);
/**
* Rotate vector v by rotation matrix R.
@@ -141,7 +141,7 @@ fp_t cosine_of_angle_diff(const vector_3_t v1, const vector_3_t v2);
* @param R Rotation matrix.
* @param res Resultant vector.
*/
-void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res);
+void rotate(const intv3_t v, const matrix_3x3_t R, intv3_t res);
/**
* Rotate vector v by rotation matrix R^-1.
@@ -150,6 +150,6 @@ void rotate(const vector_3_t v, const matrix_3x3_t R, vector_3_t res);
* @param R Rotation matrix.
* @param res Resultant vector.
*/
-void rotate_inv(const vector_3_t v, const matrix_3x3_t R, vector_3_t res);
+void rotate_inv(const intv3_t v, const matrix_3x3_t R, intv3_t res);
#endif /* __CROS_EC_MATH_UTIL_H */
diff --git a/include/motion_lid.h b/include/motion_lid.h
index 155c7735c9..6ce299c0e5 100644
--- a/include/motion_lid.h
+++ b/include/motion_lid.h
@@ -26,7 +26,7 @@ struct accel_orientation {
matrix_3x3_t rot_hinge_180;
/* Vector pointing along hinge axis. */
- vector_3_t hinge_axis;
+ intv3_t hinge_axis;
};
/* Link global structure for orientation. This must be defined in board.c. */
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 07687feb5a..bbc82a0f71 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -118,9 +118,9 @@ struct motion_sensor_t {
/* state parameters */
enum sensor_state state;
- vector_3_t raw_xyz;
- vector_3_t xyz;
- vector_3_t spoof_xyz;
+ intv3_t raw_xyz;
+ intv3_t xyz;
+ intv3_t spoof_xyz;
/* How many flush events are pending */
uint32_t flush_pending;
diff --git a/test/math_util.c b/test/math_util.c
index 3296e8da07..9a449a93a3 100644
--- a/test/math_util.c
+++ b/test/math_util.c
@@ -59,8 +59,8 @@ const matrix_3x3_t test_matrices[] = {
static int test_rotate(void)
{
int i, j, k;
- vector_3_t v = {1, 2, 3};
- vector_3_t w;
+ intv3_t v = {1, 2, 3};
+ intv3_t w;
for (i = 0; i < ARRAY_SIZE(test_matrices); i++) {
for (j = 0; j < 100; j += 10) {
diff --git a/test/motion_lid.c b/test/motion_lid.c
index adb4636e33..3282812e86 100644
--- a/test/motion_lid.c
+++ b/test/motion_lid.c
@@ -41,7 +41,7 @@ static int accel_init(const struct motion_sensor_t *s)
return EC_SUCCESS;
}
-static int accel_read(const struct motion_sensor_t *s, vector_3_t v)
+static int accel_read(const struct motion_sensor_t *s, intv3_t v)
{
rotate(s->xyz, *s->rot_standard_ref, v);
return EC_SUCCESS;