浏览代码

[common] Avoid IAR compiling error on USB HOST stack

- Avoided using a structure with zero-length array as a field in another
  structure when IAR toolchain is used.

Signed-off-by: helloeagleyang <helloeagleyang@163.com>
helloeagleyang 2 年之前
父节点
当前提交
d11260ef67
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      common/usb_hc.h

+ 4 - 0
common/usb_hc.h

@@ -59,7 +59,11 @@ struct usbh_urb {
     uint32_t start_frame;
     usbh_complete_callback_t complete;
     void *arg;
+#if defined(__ICCARM__) || defined(__ICCRISCV__) || defined(__ICCRX__)
+    struct usbh_iso_frame_packet *iso_packet;
+#else
     struct usbh_iso_frame_packet iso_packet[0];
+#endif
 };
 
 /**