summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/portable/mentor/musb/dcd_musb.c26
-rw-r--r--src/tusb_option.h14
2 files changed, 24 insertions, 16 deletions
diff --git a/src/portable/mentor/musb/dcd_musb.c b/src/portable/mentor/musb/dcd_musb.c
index 45c6fe7df..0a174065f 100644
--- a/src/portable/mentor/musb/dcd_musb.c
+++ b/src/portable/mentor/musb/dcd_musb.c
@@ -735,29 +735,39 @@ void dcd_remote_wakeup(uint8_t rhport) {
musb_regs->power &= ~MUSB_POWER_RESUME;
}
+#if defined(TUP_USBIP_MUSB_PY32)
+
// Connect by enabling internal pull-up resistor on D+/D-
void dcd_connect(uint8_t rhport)
{
- musb_regs_t* musb_regs = MUSB_REGS(rhport);
-#if defined(TUP_USBIP_MUSB_PY32)
- (void) musb_regs;
+ (void) rhport;
+}
+
+// Disconnect by disabling internal pull-up resistor on D+/D-
+void dcd_disconnect(uint8_t rhport)
+{
+ (void) rhport;
+}
+
#else
+
+// Connect by enabling internal pull-up resistor on D+/D-
+void dcd_connect(uint8_t rhport)
+{
+ musb_regs_t* musb_regs = MUSB_REGS(rhport);
musb_regs->power |= TUD_OPT_HIGH_SPEED ? MUSB_POWER_HSENAB : 0;
musb_regs->power |= MUSB_POWER_SOFTCONN;
-#endif
}
// Disconnect by disabling internal pull-up resistor on D+/D-
void dcd_disconnect(uint8_t rhport)
{
musb_regs_t* musb_regs = MUSB_REGS(rhport);
-#if defined(TUP_USBIP_MUSB_PY32)
- (void) musb_regs;
-#else
musb_regs->power &= ~MUSB_POWER_SOFTCONN;
-#endif
}
+#endif
+
void dcd_sof_enable(uint8_t rhport, bool en)
{
(void) rhport;
diff --git a/src/tusb_option.h b/src/tusb_option.h
index 0036fbe3c..f2c62cc6c 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -104,9 +104,6 @@
#define OPT_MCU_NUC120 802
#define OPT_MCU_NUC505 803
-// Puya
-#define OPT_MCU_PY32F0 850 ///< Puya PY32F0
-
// Espressif
#define OPT_MCU_ESP32S2 900 ///< Espressif ESP32-S2
#define OPT_MCU_ESP32S3 901 ///< Espressif ESP32-S3
@@ -207,6 +204,9 @@
// HPMicro
#define OPT_MCU_HPM 2600 ///< HPMicro
+// Puya
+#define OPT_MCU_PY32F0 2700 ///< Puya PY32F0
+
// Check if configured MCU is one of listed
// Apply TU_MCU_IS_EQUAL with || as separator to list of input
#define TU_MCU_IS_EQUAL(_m) (CFG_TUSB_MCU == (_m))
@@ -352,13 +352,11 @@
//------------ MUSB --------------//
#if defined(TUP_USBIP_MUSB)
#define CFG_TUD_EDPT_DEDICATED_HWFIFO 1
- #if defined(TUP_USBIP_MUSB_PY32)
- #define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 1 // 8 bit data
- #else
- #define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 4 // 32 bit data
+ #define CFG_TUSB_FIFO_HWFIFO_DATA_STRIDE 4 // 32 bit data
+ #if !defined(TUP_USBIP_MUSB_PY32)
#define CFG_TUSB_FIFO_HWFIFO_DATA_ODD_16BIT_ACCESS // allow odd 16bit access
- #define CFG_TUSB_FIFO_HWFIFO_DATA_ODD_8BIT_ACCESS // allow odd 8bit access
#endif
+ #define CFG_TUSB_FIFO_HWFIFO_DATA_ODD_8BIT_ACCESS // allow odd 8bit access
#define CFG_TUSB_FIFO_HWFIFO_ADDR_STRIDE 0 // fixed hwfifo
#endif