MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_inputcapture_open

Function rt_inputcapture_open

components/drivers/misc/rt_inputcapture.c:35–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static 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
56static rt_err_t rt_inputcapture_close(struct rt_device *dev)
57{

Callers

nothing calls this directly

Calls 1

rt_ringbuffer_createFunction · 0.85

Tested by

no test coverage detected