mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
STM32 OTG FS fix from Petteri Aimonen; Finish off some UG-2864AMBAG01 test logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5322 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3651,10 +3651,14 @@ static int stm32_epout_configure(FAR struct stm32_ep_s *privep, uint8_t eptype,
|
||||
regval = stm32_getreg(regaddr);
|
||||
if ((regval & OTGFS_DOEPCTL_USBAEP) == 0)
|
||||
{
|
||||
regval &= ~(OTGFS_DOEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK);
|
||||
if (regval & OTGFS_DOEPCTL_NAKSTS)
|
||||
{
|
||||
regval |= OTGFS_DOEPCTL_CNAK;
|
||||
}
|
||||
|
||||
regval &= ~(OTGFS_DOEPCTL_MPSIZ_MASK | OTGFS_DOEPCTL_EPTYP_MASK);
|
||||
regval |= mpsiz;
|
||||
regval |= (eptype << OTGFS_DOEPCTL_EPTYP_SHIFT);
|
||||
regval |= (eptype << OTGFS_DIEPCTL_TXFNUM_SHIFT);
|
||||
regval |= (OTGFS_DOEPCTL_SD0PID | OTGFS_DOEPCTL_USBAEP);
|
||||
stm32_putreg(regval, regaddr);
|
||||
|
||||
@@ -3743,6 +3747,11 @@ static int stm32_epin_configure(FAR struct stm32_ep_s *privep, uint8_t eptype,
|
||||
regval = stm32_getreg(regaddr);
|
||||
if ((regval & OTGFS_DIEPCTL_USBAEP) == 0)
|
||||
{
|
||||
if (regval & OTGFS_DIEPCTL_NAKSTS)
|
||||
{
|
||||
regval |= OTGFS_DIEPCTL_CNAK;
|
||||
}
|
||||
|
||||
regval &= ~(OTGFS_DIEPCTL_MPSIZ_MASK | OTGFS_DIEPCTL_EPTYP_MASK | OTGFS_DIEPCTL_TXFNUM_MASK);
|
||||
regval |= mpsiz;
|
||||
regval |= (eptype << OTGFS_DIEPCTL_EPTYP_SHIFT);
|
||||
|
||||
Reference in New Issue
Block a user