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

Function rt_inputcapture_control

components/drivers/misc/rt_inputcapture.c:100–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100static rt_err_t rt_inputcapture_control(struct rt_device *dev, int cmd, void *args)
101{
102 rt_err_t result;
103 struct rt_inputcapture_device *inputcapture;
104
105 RT_ASSERT(dev != RT_NULL);
106
107 result = RT_EOK;
108 inputcapture = (struct rt_inputcapture_device *)dev;
109 switch (cmd)
110 {
111 case INPUTCAPTURE_CMD_CLEAR_BUF:
112 if (inputcapture->ringbuff)
113 {
114 rt_ringbuffer_reset(inputcapture->ringbuff);
115 }
116 break;
117 case INPUTCAPTURE_CMD_SET_WATERMARK:
118 inputcapture->watermark = *(rt_size_t *)args;
119 break;
120 default:
121 result = -RT_ENOSYS;
122 break;
123 }
124
125 return result;
126}
127
128#ifdef RT_USING_DEVICE_OPS
129const static struct rt_device_ops inputcapture_ops =

Callers

nothing calls this directly

Calls 1

rt_ringbuffer_resetFunction · 0.85

Tested by

no test coverage detected