Skip to content

Commit 6953f8e

Browse files
authored
Merge pull request #34 from espressif/feature/proprietary_changes_main
feature(tinyusb): Implemented various changes for the main logic of driver
2 parents 7a9a901 + 26bda5e commit 6953f8e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/portable/synopsys/dwc2/dcd_dwc2.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static bool dfifo_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t packet_size) {
234234
// Check if free space is available
235235
TU_ASSERT(_dfifo_top >= fifo_size + dwc2->grxfsiz);
236236
_dfifo_top -= fifo_size;
237-
TU_LOG(DWC2_DEBUG, " TX FIFO %u: allocated %u words at offset %u\r\n", epnum, fifo_size, _dfifo_top);
237+
// TU_LOG(DWC2_DEBUG, " TX FIFO %u: allocated %u words at offset %u\r\n", epnum, fifo_size, _dfifo_top);
238238

239239
// Both TXFD and TXSA are in unit of 32-bit words.
240240
if (epnum == 0) {
@@ -683,8 +683,9 @@ bool dcd_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
683683
// Force device mode
684684
dwc2->gusbcfg = (dwc2->gusbcfg & ~GUSBCFG_FHMOD) | GUSBCFG_FDMOD;
685685

686-
// Clear A override, force B Valid
687-
dwc2->gotgctl = (dwc2->gotgctl & ~GOTGCTL_AVALOEN) | GOTGCTL_BVALOEN | GOTGCTL_BVALOVAL;
686+
// No overrides
687+
dwc2->gotgctl &= ~(GOTGCTL_BVALOEN | GOTGCTL_BVALOVAL | GOTGCTL_VBVALOVAL);
688+
688689

689690
// If USB host misbehaves during status portion of control xfer
690691
// (non zero-length packet), send STALL back and discard.

src/tusb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ bool tusb_rhport_init(uint8_t rhport, const tusb_rhport_init_t* rh_init) {
5757
.role = TUSB_ROLE_DEVICE,
5858
.speed = TUD_OPT_HIGH_SPEED ? TUSB_SPEED_HIGH : TUSB_SPEED_FULL
5959
};
60-
TU_ASSERT ( tud_rhport_init(rhport, &dev_init) );
60+
TU_ASSERT ( tud_rhport_init(TUD_OPT_RHPORT, &dev_init) );
6161
_rhport_role[TUD_OPT_RHPORT] = TUSB_ROLE_DEVICE;
6262
#endif
6363

0 commit comments

Comments
 (0)