diff options
Diffstat (limited to 'board/volteer')
-rw-r--r-- | board/volteer/sensors.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/board/volteer/sensors.c b/board/volteer/sensors.c index 1bf5df3a06..78c96b9672 100644 --- a/board/volteer/sensors.c +++ b/board/volteer/sensors.c @@ -19,8 +19,8 @@ /******************************************************************************/ /* Sensors */ -static struct mutex g_lid_accel_mutex; -static struct mutex g_base_mutex; +static mutex_t g_lid_accel_mutex; +static mutex_t g_base_mutex; /* BMA253 private data */ static struct accelgyro_saved_data_t g_bma253_data; @@ -213,6 +213,19 @@ const struct motion_sensor_t *motion_als_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); +#ifdef CONFIG_ZEPHYR +static int init_sensor_mutex(const struct device *dev) +{ + ARG_UNUSED(dev); + + k_mutex_init(&g_lid_accel_mutex); + k_mutex_init(&g_base_mutex); + + return 0; +} +SYS_INIT(init_sensor_mutex, POST_KERNEL, 50); +#endif /* CONFIG_ZEPHYR */ + static void baseboard_sensors_init(void) { /* Note - BMA253 interrupt unused by EC */ |