Browse Source

Set USBHS_USBCMD_ITC to 1, workaround for race condition in some drivers

main
PaulStoffregen 3 years ago
parent
commit
efaf5cb56f
2 changed files with 10 additions and 1 deletions
  1. +9
    -0
      USBHost_t36.h
  2. +1
    -1
      ehci.cpp

+ 9
- 0
USBHost_t36.h View File

//#define USBHOST_PRINT_DEBUG //#define USBHOST_PRINT_DEBUG




// When developing a new driver, please edit ehci.cpp to set
// USBHS_USBCMD_ITC to zero. Today we set USBHS_USBCMD_ITC(1)
// because some drivers have race conditions exposed by
// non-delayed interrupts. Eventually USBHS_USBCMD_ITC will
// be changed to 0. Please test any new driver code with
// USBHS_USBCMD_ITC(0) so it won't break in the future when
// this change is made!


// This can let you control where to send the debugging messages // This can let you control where to send the debugging messages
//#define USBHDBGSerial Serial1 //#define USBHDBGSerial Serial1
#ifndef USBHDBGSerial #ifndef USBHDBGSerial

+ 1
- 1
ehci.cpp View File

USBHS_PERIODICLISTBASE = (uint32_t)periodictable; USBHS_PERIODICLISTBASE = (uint32_t)periodictable;
USBHS_FRINDEX = 0; USBHS_FRINDEX = 0;
USBHS_ASYNCLISTADDR = 0; USBHS_ASYNCLISTADDR = 0;
USBHS_USBCMD = USBHS_USBCMD_ITC(0) | USBHS_USBCMD_RS |
USBHS_USBCMD = USBHS_USBCMD_ITC(1) | USBHS_USBCMD_RS |
USBHS_USBCMD_ASP(3) | USBHS_USBCMD_ASPE | USBHS_USBCMD_PSE | USBHS_USBCMD_ASP(3) | USBHS_USBCMD_ASPE | USBHS_USBCMD_PSE |
#if PERIODIC_LIST_SIZE == 8 #if PERIODIC_LIST_SIZE == 8
USBHS_USBCMD_FS2 | USBHS_USBCMD_FS(3); USBHS_USBCMD_FS2 | USBHS_USBCMD_FS(3);

Loading…
Cancel
Save