remove intf malloc

This commit is contained in:
sakumisu
2022-10-20 21:22:08 +08:00
parent 731f206254
commit dca8b4cfed
36 changed files with 178 additions and 247 deletions

View File

@@ -90,14 +90,8 @@ static void cdc_notify_handler(uint8_t event, void *arg)
}
}
struct usbd_interface *usbd_cdc_acm_alloc_intf(void)
struct usbd_interface *usbd_cdc_acm_init_intf(struct usbd_interface *intf)
{
struct usbd_interface *intf = usb_malloc(sizeof(struct usbd_interface));
if (intf == NULL) {
USB_LOG_ERR("no mem to alloc intf\r\n");
return NULL;
}
intf->class_interface_handler = cdc_acm_class_interface_request_handler;
intf->class_endpoint_handler = NULL;
intf->vendor_handler = NULL;

View File

@@ -12,8 +12,8 @@
extern "C" {
#endif
/* Alloc cdc acm interface driver */
struct usbd_interface *usbd_cdc_acm_alloc_intf(void);
/* Init cdc acm interface driver */
struct usbd_interface *usbd_cdc_acm_init_intf(struct usbd_interface *intf);
/* Setup request command callback api */
void usbd_cdc_acm_set_line_coding(uint8_t intf, struct cdc_line_coding *line_coding);