Просмотр исходного кода

bugfix: Fix some compilation errors

LiPeng 4 месяцев назад
Родитель
Сommit
c77557510e
5 измененных файлов с 6 добавлено и 12 удалено
  1. 2 0
      Kconfig
  2. 0 4
      class/aoa/usbh_aoa.c
  3. 1 2
      class/dfu/usbd_dfu.c
  4. 3 3
      class/vendor/net/usbh_rtl8152.c
  5. 0 3
      osal/idf/usb_config.h

+ 2 - 0
Kconfig

@@ -118,6 +118,7 @@ if CHERRYUSB
         config CHERRYUSB_DEVICE_CDC_NCM
             bool
             prompt "Enable usb cdc ncm device"
+            depends on !IDF_CMAKE
             default n
 
         config CHERRYUSB_DEVICE_MTP
@@ -338,6 +339,7 @@ if CHERRYUSB
         config CHERRYUSB_HOST_BLUETOOTH
             bool
             prompt "Enable usb bluetooth driver"
+            depends on !IDF_CMAKE
             default n
 
         config CHERRYUSB_HOST_ASIX

+ 0 - 4
class/aoa/usbh_aoa.c

@@ -176,9 +176,6 @@ int usbh_aoa_register_hid(struct usbh_aoa *aoa_class, uint16_t id, uint8_t *repo
 int usbh_aoa_send_hid_event(struct usbh_aoa *aoa_class, uint16_t id, uint8_t *event, uint32_t event_len)
 {
     struct usb_setup_packet *setup;
-    int ret;
-    uint8_t len;
-    uint32_t offset;
 
     if (!aoa_class || !aoa_class->hport) {
         return -USB_ERR_INVAL;
@@ -198,7 +195,6 @@ int usbh_aoa_send_hid_event(struct usbh_aoa *aoa_class, uint16_t id, uint8_t *ev
 static int usbh_aoa_connect(struct usbh_hubport *hport, uint8_t intf)
 {
     struct usb_endpoint_descriptor *ep_desc;
-    int ret = 0;
 
     struct usbh_aoa *aoa_class = &g_aoa_class;
 

+ 1 - 2
class/dfu/usbd_dfu.c

@@ -106,7 +106,6 @@ static void dfu_request_upload(struct usb_setup_packet *setup, uint8_t **data, u
 {
     struct usb_setup_packet *req = setup;
     uint32_t addr;
-    uint8_t *phaddr;
     /* Data setup request */
     if (req->wLength > 0U) {
         if ((g_usbd_dfu.dev_state == DFU_STATE_DFU_IDLE) || (g_usbd_dfu.dev_state == DFU_STATE_DFU_UPLOAD_IDLE)) {
@@ -143,7 +142,7 @@ static void dfu_request_upload(struct usb_setup_packet *setup, uint8_t **data, u
                 addr = ((g_usbd_dfu.wblock_num - 2U) * USBD_DFU_XFER_SIZE) + g_usbd_dfu.data_ptr;
 
                 /* Return the physical address where data are stored */
-                phaddr = dfu_read_flash((uint8_t *)addr, g_usbd_dfu.buffer.d8, g_usbd_dfu.wlength);
+                dfu_read_flash((uint8_t *)addr, g_usbd_dfu.buffer.d8, g_usbd_dfu.wlength);
 
                 /* Send the status data over EP0 */
                 memcpy(*data, g_usbd_dfu.buffer.d8, g_usbd_dfu.wlength);

+ 3 - 3
class/vendor/net/usbh_rtl8152.c

@@ -1034,17 +1034,17 @@ static int generic_ocp_read(struct usbh_rtl8152 *tp, uint16_t index, uint16_t si
 static int generic_ocp_write(struct usbh_rtl8152 *tp, uint16_t index, uint16_t byteen,
                              uint16_t size, void *data, uint16_t type)
 {
-    int ret;
+    int ret = -USB_ERR_INVAL;
     uint16_t byteen_start, byteen_end, byen;
     uint16_t limit = 512;
     uint8_t *buf = data;
 
     /* both size and indix must be 4 bytes align */
     if ((size & 3) || !size || (index & 3) || !buf)
-        return -USB_ERR_INVAL;
+        return ret;
 
     if ((uint32_t)index + (uint32_t)size > 0xffff)
-        return -USB_ERR_INVAL;
+        return ret;
 
     byteen_start = byteen & BYTE_EN_START_MASK;
     byteen_end = byteen & BYTE_EN_END_MASK;

+ 0 - 3
osal/idf/usb_config.h

@@ -144,9 +144,6 @@
 #define CONFIG_USBDEV_RNDIS_VENDOR_DESC "CherryUSB"
 #endif
 
-#define CONFIG_USBDEV_RNDIS_USING_LWIP
-#define CONFIG_USBDEV_CDC_ECM_USING_LWIP
-
 /* ================ USB HOST Stack Configuration ================== */
 
 #define CONFIG_USBHOST_MAX_RHPORTS          1