diff --git a/drivers/sensor/mpu9250/mpu9250.h b/drivers/sensor/mpu9250/mpu9250.h index 88e5b56e89..398a6c92f2 100644 --- a/drivers/sensor/mpu9250/mpu9250.h +++ b/drivers/sensor/mpu9250/mpu9250.h @@ -41,7 +41,7 @@ struct mpu9250_data { const struct device *dev; struct gpio_callback gpio_cb; - struct sensor_trigger data_ready_trigger; + const struct sensor_trigger *data_ready_trigger; sensor_trigger_handler_t data_ready_handler; #if defined(CONFIG_MPU9250_TRIGGER_OWN_THREAD) diff --git a/drivers/sensor/mpu9250/mpu9250_trigger.c b/drivers/sensor/mpu9250/mpu9250_trigger.c index 1007a50761..722deab86d 100644 --- a/drivers/sensor/mpu9250/mpu9250_trigger.c +++ b/drivers/sensor/mpu9250/mpu9250_trigger.c @@ -39,7 +39,7 @@ int mpu9250_trigger_set(const struct device *dev, return 0; } - drv_data->data_ready_trigger = *trig; + drv_data->data_ready_trigger = trig; ret = gpio_pin_interrupt_configure_dt(&cfg->int_pin, GPIO_INT_EDGE_TO_ACTIVE); @@ -82,7 +82,7 @@ static void mpu9250_thread_cb(const struct device *dev) if (drv_data->data_ready_handler != NULL) { drv_data->data_ready_handler(dev, - &drv_data->data_ready_trigger); + drv_data->data_ready_trigger); } ret = gpio_pin_interrupt_configure_dt(&cfg->int_pin,