mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-19 02:23:32 +08:00
[sensor] change RT_SENSOR_FLAG_FIFO to RT_DEVICE_FLAG_FIFO_RX
This commit is contained in:
parent
3d9c306454
commit
fb9482d61b
@ -179,7 +179,7 @@ static rt_err_t rt_sensor_open(rt_device_t dev, rt_uint16_t oflag)
|
||||
rt_sensor_irq_init(sensor);
|
||||
}
|
||||
}
|
||||
else if (oflag & RT_SENSOR_FLAG_FIFO && dev->flag & RT_SENSOR_FLAG_FIFO)
|
||||
else if (oflag & RT_DEVICE_FLAG_FIFO_RX && dev->flag & RT_DEVICE_FLAG_FIFO_RX)
|
||||
{
|
||||
/* If fifo mode is supported, configure it to fifo mode */
|
||||
if (sensor->ops->control(sensor, RT_SENSOR_CTRL_SET_MODE, (void *)RT_SENSOR_MODE_FIFO) == RT_EOK)
|
||||
|
@ -25,7 +25,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#define RT_PIN_NONE 0xFFFF /* RT PIN NONE */
|
||||
#define RT_SENSOR_FLAG_FIFO 0x200 /* Flag to use when the sensor is open by fifo mode */
|
||||
#define RT_DEVICE_FLAG_FIFO_RX 0x200 /* Flag to use when the sensor is open by fifo mode */
|
||||
|
||||
#define RT_SENSOR_MODULE_MAX (3) /* The maximum number of members of a sensor module */
|
||||
|
||||
|
@ -119,7 +119,7 @@ static void sensor_fifo(int argc, char **argv)
|
||||
|
||||
rt_device_set_rx_indicate(dev, rx_callback);
|
||||
|
||||
if (rt_device_open(dev, RT_SENSOR_FLAG_FIFO) != RT_EOK)
|
||||
if (rt_device_open(dev, RT_DEVICE_FLAG_FIFO_RX) != RT_EOK)
|
||||
{
|
||||
LOG_E("open device failed!");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user