summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/config.h2
-rw-r--r--include/motion_sense.h4
2 files changed, 6 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index f60766d165..5709cfe1d2 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1385,6 +1385,8 @@
*/
#define CONFIG_MOTION_SENSE_SUSPEND_DELAY_US 0
+/* Define motion sensor count in board layer */
+#undef CONFIG_DYNAMIC_MOTION_SENSOR_COUNT
/******************************************************************************/
/* Host to RAM (H2RAM) Memory Mapping */
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[];