summaryrefslogtreecommitdiff
path: root/include/motion_sense.h
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2017-10-10 15:53:39 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-10-11 16:11:09 -0700
commit0c7c687a1e0e0085c0af36f8ae90249d1f09ecba (patch)
treed73671aabc2ad512ce630636b8d97096398a1e72 /include/motion_sense.h
parent465de629d3f627fb6378649330189bf033f645ad (diff)
downloadchrome-ec-0c7c687a1e0e0085c0af36f8ae90249d1f09ecba.tar.gz
motion_sense: Add CONFIG_DYNAMIC_MOTION_SENSOR_COUNT config option
Some projects, such as Coral use a common image to support different SKUs. In this case the number of motion sensors supported may need to be determined at runtime. CONFIG_DYNAMIC_MOTION_SENSOR_COUNT removes the const assumption for the global variable motion_sensor_count. Based on CL https://chromium-review.googlesource.com/444587 BUG=b:38271876 BRANCH=None TEST=make -j buildall Change-Id: I4dd3384d245641136f3329b60d1d941927366387 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/711194 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'include/motion_sense.h')
-rw-r--r--include/motion_sense.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/motion_sense.h b/include/motion_sense.h
index 553cf0ca7e..478468022e 100644
--- a/include/motion_sense.h
+++ b/include/motion_sense.h
@@ -157,7 +157,11 @@ struct motion_sensor_t {
/* Defined at board level. */
extern struct motion_sensor_t motion_sensors[];
+#ifdef CONFIG_DYNAMIC_MOTION_SENSOR_COUNT
+extern unsigned motion_sensor_count;
+#else
extern const unsigned motion_sensor_count;
+#endif
#if (!defined HAS_TASK_ALS) && (defined CONFIG_ALS)
/* Needed if reading ALS via LPC is needed */
extern const struct motion_sensor_t *motion_als_sensors[];