diff --git a/src/portable/renesas/rusb2/dcd_rusb2.c b/src/portable/renesas/rusb2/dcd_rusb2.c index f0ef9738b9..cfc65e6824 100644 --- a/src/portable/renesas/rusb2/dcd_rusb2.c +++ b/src/portable/renesas/rusb2/dcd_rusb2.c @@ -51,10 +51,10 @@ static dcd_data_t _dcd; // - Pipes 3 to 5: Bulk // - Pipes 6 to 9: Interrupt // -// Note: for small mcu such as -// - RA2A1: only pipe 4-7 are available, and no support for ISO +// Note: for small mcu which only support device mode +// only pipe 4-7 are available, and no support for ISO static unsigned find_pipe(unsigned xfer_type) { - #if defined(BSP_MCU_GROUP_RA2A1) + #ifdef RUSB2_RA_USBFS_DEVICE_ONLY const uint8_t pipe_idx_arr[4][2] = { { 0, 0 }, // Control { 0, 0 }, // Isochronous not supported diff --git a/src/portable/renesas/rusb2/hcd_rusb2.c b/src/portable/renesas/rusb2/hcd_rusb2.c index 849551d278..b5e51e2c4b 100644 --- a/src/portable/renesas/rusb2/hcd_rusb2.c +++ b/src/portable/renesas/rusb2/hcd_rusb2.c @@ -11,6 +11,10 @@ #if CFG_TUH_ENABLED && defined(TUP_USBIP_RUSB2) +#ifdef RUSB2_RA_USBFS_DEVICE_ONLY +#error "Host mode not supported for this device" +#endif + #include "host/hcd.h" #include "host/usbh.h" #include "rusb2_common.h" diff --git a/src/portable/renesas/rusb2/rusb2_common.h b/src/portable/renesas/rusb2/rusb2_common.h index 90abdf4b95..7d7cb3b5f1 100644 --- a/src/portable/renesas/rusb2/rusb2_common.h +++ b/src/portable/renesas/rusb2/rusb2_common.h @@ -14,8 +14,8 @@ #elif TU_CHECK_MCU(OPT_MCU_RAXXX) #include "rusb2_ra.h" - // Hack for D0FIFO definitions on RA Cortex-M23 - #if defined(RENESAS_CORTEX_M23) + // Hack for D0FIFO definitions on RA with usb device support only + #ifdef RUSB2_RA_USBFS_DEVICE_ONLY #define D0FIFO CFIFO #define D0FIFOSEL CFIFOSEL #define D0FIFOSEL_b CFIFOSEL_b diff --git a/src/portable/renesas/rusb2/rusb2_ra.h b/src/portable/renesas/rusb2/rusb2_ra.h index e5945ffe21..48e7233e66 100644 --- a/src/portable/renesas/rusb2/rusb2_ra.h +++ b/src/portable/renesas/rusb2/rusb2_ra.h @@ -38,6 +38,10 @@ extern "C" { // //--------------------------------------------------------------------+ +#if defined(BSP_MCU_GROUP_RA2A1) || defined(BSP_MCU_GROUP_RA2L2) || defined(BSP_MCU_GROUP_RA4E2) || defined(BSP_MCU_GROUP_RA6E2) || defined(BSP_MCU_GROUP_RA6T3) +#define RUSB2_RA_USBFS_DEVICE_ONLY +#endif + typedef struct { uint32_t reg_base; int32_t irqnum;