summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2018-09-08 00:31:36 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-13 06:13:51 -0700
commitcb49a07fd350d9b513b019f755730d298bf719e7 (patch)
tree49057db244ea0b103c1026e4b9aea2ce5037af1e /board
parentc857c83cca204ab23e5d355ac1751b3cd7d95fb8 (diff)
downloadchrome-ec-cb49a07fd350d9b513b019f755730d298bf719e7.tar.gz
type: Rename matrix_3x3_t to mat33_fp_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: I51d88d44252184e4b7b3564236833b0b892edc39 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1215449 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/atlas/board.c2
-rw-r--r--board/bobba/board.c2
-rw-r--r--board/cheza/board.c2
-rw-r--r--board/coral/board.c4
-rw-r--r--board/elm/board.c4
-rw-r--r--board/eve/board.c4
-rw-r--r--board/fleex/board.c4
-rw-r--r--board/kukui/board.c2
-rw-r--r--board/meep/board.c2
-rw-r--r--board/nami/board.c6
-rw-r--r--board/nautilus/board.c4
-rw-r--r--board/nocturne/board.c2
-rw-r--r--board/oak/board.c2
-rw-r--r--board/phaser/board.c2
-rw-r--r--board/poppy/board.c8
-rw-r--r--board/rainier/board.c2
-rw-r--r--board/rammus/board.c4
-rw-r--r--board/reef/board.c4
-rw-r--r--board/reef_mchp/board.c4
-rw-r--r--board/rowan/board.c2
-rw-r--r--board/samus/board.c4
-rw-r--r--board/scarlet/board.c2
-rw-r--r--board/strago/board.c4
-rw-r--r--board/yorp/board.c2
24 files changed, 39 insertions, 39 deletions
diff --git a/board/atlas/board.c b/board/atlas/board.c
index 09cb8c3a25..6e403bfd8f 100644
--- a/board/atlas/board.c
+++ b/board/atlas/board.c
@@ -577,7 +577,7 @@ static struct opt3001_drv_data_t g_opt3001_data = {
};
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/bobba/board.c b/board/bobba/board.c
index 9b0bc42ebf..9245f71821 100644
--- a/board/bobba/board.c
+++ b/board/bobba/board.c
@@ -117,7 +117,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/cheza/board.c b/board/cheza/board.c
index c514a0875e..3e176736fd 100644
--- a/board/cheza/board.c
+++ b/board/cheza/board.c
@@ -474,7 +474,7 @@ static struct mutex g_lid_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/coral/board.c b/board/coral/board.c
index 2cf54638e5..e651561e11 100644
--- a/board/coral/board.c
+++ b/board/coral/board.c
@@ -710,13 +710,13 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
-const matrix_3x3_t mag_standard_ref = {
+const mat33_fp_t mag_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/elm/board.c b/board/elm/board.c
index 7ebf20225b..67a60d1aed 100644
--- a/board/elm/board.c
+++ b/board/elm/board.c
@@ -438,13 +438,13 @@ DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
static struct mutex g_kx022_mutex[2];
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/eve/board.c b/board/eve/board.c
index 30089a3321..9943d4688b 100644
--- a/board/eve/board.c
+++ b/board/eve/board.c
@@ -786,13 +786,13 @@ static struct si114x_drv_data_t g_si114x_data = {
};
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t mag_standard_ref = {
+const mat33_fp_t mag_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/fleex/board.c b/board/fleex/board.c
index 220c031c95..d9227928b7 100644
--- a/board/fleex/board.c
+++ b/board/fleex/board.c
@@ -115,13 +115,13 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
- const matrix_3x3_t base_standard_ref = {
+ const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/kukui/board.c b/board/kukui/board.c
index 5509aee78a..5d610c83a4 100644
--- a/board/kukui/board.c
+++ b/board/kukui/board.c
@@ -353,7 +353,7 @@ static struct mutex g_base_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/meep/board.c b/board/meep/board.c
index 83fe05a50f..725e8b186b 100644
--- a/board/meep/board.c
+++ b/board/meep/board.c
@@ -122,7 +122,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/nami/board.c b/board/nami/board.c
index 76edea3f73..cb5efe7bf6 100644
--- a/board/nami/board.c
+++ b/board/nami/board.c
@@ -683,19 +683,19 @@ static struct kionix_accel_data g_kx022_data;
static struct accelgyro_saved_data_t g_bma255_data;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
-const matrix_3x3_t rotation_x180_z90 = {
+const mat33_fp_t rotation_x180_z90 = {
{ 0, FLOAT_TO_FP(-1), 0 },
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, 0, FLOAT_TO_FP(-1) }
diff --git a/board/nautilus/board.c b/board/nautilus/board.c
index 39d46283e5..e765064bf6 100644
--- a/board/nautilus/board.c
+++ b/board/nautilus/board.c
@@ -621,13 +621,13 @@ static struct bmi160_drv_data_t g_bmi160_data;
static struct accelgyro_saved_data_t g_bma255_data;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, FLOAT_TO_FP(1), 0 },
{ 0, 0, FLOAT_TO_FP(-1) }
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, FLOAT_TO_FP(1), 0 },
{ 0, 0, FLOAT_TO_FP(-1) }
diff --git a/board/nocturne/board.c b/board/nocturne/board.c
index 4afb2fb581..fd61390cc1 100644
--- a/board/nocturne/board.c
+++ b/board/nocturne/board.c
@@ -159,7 +159,7 @@ static struct opt3001_drv_data_t g_opt3001_data = {
};
/* Matrix to rotate accel/gyro into standard reference frame. */
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/oak/board.c b/board/oak/board.c
index ae5fbbbb2e..4fd49330d1 100644
--- a/board/oak/board.c
+++ b/board/oak/board.c
@@ -606,7 +606,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/phaser/board.c b/board/phaser/board.c
index b529f83787..d66c0236ac 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -101,7 +101,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate lid and base sensor into standard reference frame */
-const matrix_3x3_t standard_rot_ref = {
+const mat33_fp_t standard_rot_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/poppy/board.c b/board/poppy/board.c
index e20685e40f..61b990b7a2 100644
--- a/board/poppy/board.c
+++ b/board/poppy/board.c
@@ -746,27 +746,27 @@ static struct opt3001_drv_data_t g_opt3001_data = {
};
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t mag_standard_ref = {
+const mat33_fp_t mag_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
#ifdef BOARD_SORAKA
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
/* For rev3 and older */
-const matrix_3x3_t lid_standard_ref_old = {
+const mat33_fp_t lid_standard_ref_old = {
{FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
#else
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/rainier/board.c b/board/rainier/board.c
index 0b61cd03e1..c3b7fab020 100644
--- a/board/rainier/board.c
+++ b/board/rainier/board.c
@@ -350,7 +350,7 @@ static struct mutex g_base_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/rammus/board.c b/board/rammus/board.c
index 7bf268ec69..2b6c528b4a 100644
--- a/board/rammus/board.c
+++ b/board/rammus/board.c
@@ -563,13 +563,13 @@ static struct bmi160_drv_data_t g_bmi160_data;
static struct accelgyro_saved_data_t g_bma255_data;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, FLOAT_TO_FP(1), 0 },
{ 0, 0, FLOAT_TO_FP(-1) }
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0 },
{ 0, FLOAT_TO_FP(1), 0 },
{ 0, 0, FLOAT_TO_FP(-1) }
diff --git a/board/reef/board.c b/board/reef/board.c
index d5cbe46099..54766f73b9 100644
--- a/board/reef/board.c
+++ b/board/reef/board.c
@@ -696,13 +696,13 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
-const matrix_3x3_t mag_standard_ref = {
+const mat33_fp_t mag_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/reef_mchp/board.c b/board/reef_mchp/board.c
index 81d6134915..91dc329b0c 100644
--- a/board/reef_mchp/board.c
+++ b/board/reef_mchp/board.c
@@ -962,13 +962,13 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
-const matrix_3x3_t mag_standard_ref = {
+const mat33_fp_t mag_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/rowan/board.c b/board/rowan/board.c
index 8feda44674..15c54b8392 100644
--- a/board/rowan/board.c
+++ b/board/rowan/board.c
@@ -441,7 +441,7 @@ BUILD_ASSERT(ARRAY_SIZE(als) == ALS_COUNT);
static struct mutex g_lid_mutex;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/samus/board.c b/board/samus/board.c
index 646d8ded9a..b8f66ca101 100644
--- a/board/samus/board.c
+++ b/board/samus/board.c
@@ -299,13 +299,13 @@ struct lsm6ds0_data g_saved_data[2];
/* Four Motion sensors */
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
{FLOAT_TO_FP(-1), 0, 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/scarlet/board.c b/board/scarlet/board.c
index 4a785e8655..adfee70cd7 100644
--- a/board/scarlet/board.c
+++ b/board/scarlet/board.c
@@ -372,7 +372,7 @@ static struct mutex g_base_mutex;
static struct bmi160_drv_data_t g_bmi160_data;
/* Matrix to rotate accelerometer into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(1)}
diff --git a/board/strago/board.c b/board/strago/board.c
index 05bd7fda17..7b7304e374 100644
--- a/board/strago/board.c
+++ b/board/strago/board.c
@@ -183,13 +183,13 @@ static struct mutex g_kxcj9_mutex[2];
struct kionix_accel_data g_kxcj9_data[2];
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(1), 0},
{FLOAT_TO_FP(-1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}
};
-const matrix_3x3_t lid_standard_ref = {
+const mat33_fp_t lid_standard_ref = {
{FLOAT_TO_FP(-1), 0, 0},
{ 0, FLOAT_TO_FP(-1), 0},
{ 0, 0, FLOAT_TO_FP(-1)}
diff --git a/board/yorp/board.c b/board/yorp/board.c
index 920bcf661b..5cbce8d72f 100644
--- a/board/yorp/board.c
+++ b/board/yorp/board.c
@@ -98,7 +98,7 @@ static struct mutex g_lid_mutex;
static struct mutex g_base_mutex;
/* Matrix to rotate accelrator into standard reference frame */
-const matrix_3x3_t base_standard_ref = {
+const mat33_fp_t base_standard_ref = {
{ 0, FLOAT_TO_FP(-1), 0},
{ FLOAT_TO_FP(1), 0, 0},
{ 0, 0, FLOAT_TO_FP(1)}