diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-05 23:21:13 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-04-05 23:21:13 +0000 |
commit | c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62 (patch) | |
tree | c760d74a8cf34a03ebc19ecc05f248e1944ec296 /nuttx/arch/arm/src | |
parent | 559f6b32a41c0f2a8f90cb1a70d4f94c5aabb42b (diff) | |
download | px4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.tar.gz px4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.tar.bz2 px4-nuttx-c0d8ad0f16f6e77ddb4dfd1791f6c93b1aa0ce62.zip |
Fix compilation errors with floating point is enabled and field widths are disabled (I don't know why you would do that, but the code was wrong)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4562 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src')
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_otgfsdev.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c index 3e7fcbd15..a34dafe04 100755 --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c @@ -2763,6 +2763,8 @@ static void stm32_ep0configure(FAR struct stm32_usbdev_s *priv) static int stm32_epdisable(FAR struct usbdev_ep_s *ep) { FAR struct stm32_ep_s *privep = (FAR struct stm32_ep_s *)ep; + uint32_t regaddr; + uint32_t regval; irqstate_t flags; #ifdef CONFIG_DEBUG @@ -2774,20 +2776,39 @@ static int stm32_epdisable(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPDISABLE, privep->epphy); - flags = irqsave(); - - /* Disable Endpoint */ + /* Is this an IN or an OUT endpoint */ + flags = irqsave(); if (privep->isin) { -#warning "Missing logic" + /* Deactivate the endpoint */ + + regaddr = STM32_OTGFS_DIEPCTL(privep->epphy); + regval = stm32_getreg(regaddr); + regval &= ~OTGFS_DIEPCTL0_USBAEP; + stm32_putreg(regval, regaddr); + + /* Disable endpoint interrupts */ + + regval = stm32_getreg(STM32_OTGFS_DAINTMSK); + regval &= ~OTGFS_DAINT_IEP(privep->epphy); + stm32_putreg(regval, STM32_OTGFS_DAINTMSK); } else { -#warning "Missing logic" - } + /* Deactivate the endpoint */ - privep->stalled = true; + regaddr = priv, STM32_OTGFS_DOEPCTL(privep->epphy); + regval = stm32_getreg(regaddr); + regval &= ~OTGFS_DOEPCTL_USBAEP; + stm32_putreg(regval, regaddr); + + /* Disable endpoint interrupts */ + + regval = stm32_getreg(STM32_OTGFS_DAINTMSK); + regval &= ~OTGFS_DAINT_OEP(privep->epphy); + stm32_putreg(regval, STM32_OTGFS_DAINTMSK); + } /* Cancel any ongoing activity */ |