| 98 | } |
| 99 | |
| 100 | static 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 |
| 129 | const static struct rt_device_ops inputcapture_ops = |
nothing calls this directly
no test coverage detected