未验证 提交 f9c5007c 编写于 作者: B Bernard Xiong 提交者: GitHub

Merge pull request #3271 from fmkong/sensor_irq_disable

[drivers/sensor]disable irq only when the sensor and module sensors a…
......@@ -216,12 +216,6 @@ static rt_err_t rt_sensor_close(rt_device_t dev)
sensor->config.power = RT_SENSOR_POWER_DOWN;
}
/* Sensor disable interrupt */
if (sensor->config.irq_pin.pin != RT_PIN_NONE)
{
rt_pin_irq_enable(sensor->config.irq_pin.pin, RT_FALSE);
}
if (sensor->module != RT_NULL && sensor->info.fifo_max > 0 && sensor->data_buf != RT_NULL)
{
for (i = 0; i < sensor->module->sen_num; i ++)
......@@ -240,6 +234,11 @@ static rt_err_t rt_sensor_close(rt_device_t dev)
}
}
}
/* Sensor disable interrupt */
if (sensor->config.irq_pin.pin != RT_PIN_NONE)
{
rt_pin_irq_enable(sensor->config.irq_pin.pin, RT_FALSE);
}
__exit:
if (sensor->module)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册