| 33 | } |
| 34 | |
| 35 | static rt_err_t rt_inputcapture_open(struct rt_device *dev, rt_uint16_t oflag) |
| 36 | { |
| 37 | rt_err_t ret; |
| 38 | struct rt_inputcapture_device *inputcapture; |
| 39 | |
| 40 | RT_ASSERT(dev != RT_NULL); |
| 41 | |
| 42 | ret = RT_EOK; |
| 43 | inputcapture = (struct rt_inputcapture_device *)dev; |
| 44 | if (inputcapture->ringbuff == RT_NULL) |
| 45 | { |
| 46 | inputcapture->ringbuff = rt_ringbuffer_create(sizeof(struct rt_inputcapture_data) * RT_INPUT_CAPTURE_RB_SIZE); |
| 47 | } |
| 48 | if (inputcapture->ops->open) |
| 49 | { |
| 50 | ret = inputcapture->ops->open(inputcapture); |
| 51 | } |
| 52 | |
| 53 | return ret; |
| 54 | } |
| 55 | |
| 56 | static rt_err_t rt_inputcapture_close(struct rt_device *dev) |
| 57 | { |
nothing calls this directly
no test coverage detected