From d11260ef67934819f33ceaea0a0caae818b9872c Mon Sep 17 00:00:00 2001 From: helloeagleyang Date: Sat, 16 Sep 2023 12:06:56 +0800 Subject: [PATCH] [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 --- common/usb_hc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/usb_hc.h b/common/usb_hc.h index dfe20703..95215841 100644 --- a/common/usb_hc.h +++ b/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 }; /**