parent
ec9629b5f0
commit
c28b79b7d7
|
@ -62,6 +62,8 @@ extern "C" {
|
|||
} \
|
||||
}while(0)
|
||||
|
||||
#define RT_USBD_CLASS_CTRL_CONNECTED (RT_DEVICE_CTRL_BASE(USBDevice) + 0)
|
||||
|
||||
struct ufunction;
|
||||
struct udevice;
|
||||
struct uendpoint;
|
||||
|
|
|
@ -670,6 +670,12 @@ static rt_err_t _vcom_configure(struct rt_serial_device *serial,
|
|||
static rt_err_t _vcom_control(struct rt_serial_device *serial,
|
||||
int cmd, void *arg)
|
||||
{
|
||||
struct ufunction *func;
|
||||
struct vcom *data;
|
||||
|
||||
func = (struct ufunction*)serial->parent.user_data;
|
||||
data = (struct vcom*)func->user_data;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case RT_DEVICE_CTRL_CLR_INT:
|
||||
|
@ -678,6 +684,9 @@ static rt_err_t _vcom_control(struct rt_serial_device *serial,
|
|||
case RT_DEVICE_CTRL_SET_INT:
|
||||
/* enable rx irq */
|
||||
break;
|
||||
case RT_USBD_CLASS_CTRL_CONNECTED:
|
||||
(*(rt_bool_t*)arg) = data->connected;
|
||||
break;
|
||||
}
|
||||
|
||||
return RT_EOK;
|
||||
|
|
Loading…
Reference in New Issue