mbed library sources
Dependents: Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more
Superseded
This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.
Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.
If you are looking for a stable and tested release, please import one of the official mbed library releases:
Import librarymbed
The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Diff: targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_ll_usb.c
- Revision:
- 610:813dcc80987e
- Parent:
- 573:ad23fe03a082
--- a/targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_ll_usb.c Fri Aug 14 12:45:09 2015 +0100 +++ b/targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_ll_usb.c Fri Aug 14 13:15:17 2015 +0100 @@ -2,8 +2,8 @@ ****************************************************************************** * @file stm32f7xx_ll_usb.c * @author MCD Application Team - * @version V1.0.0 - * @date 12-May-2015 + * @version V1.0.1 + * @date 25-June-2015 * @brief USB Low Layer HAL module driver. * * This file provides firmware functions to manage the following @@ -335,7 +335,7 @@ { uint32_t count = 0; - USBx->GRSTCTL = ( USB_OTG_GRSTCTL_TXFFLSH |(uint32_t)( num << 5 )); + USBx->GRSTCTL = ( USB_OTG_GRSTCTL_TXFFLSH |(uint32_t)( num << 6)); do { @@ -1430,7 +1430,8 @@ uint16_t len_words = 0; uint16_t num_packets = 0; uint16_t max_hc_pkt_count = 256; - + uint32_t tmpreg = 0; + if((USBx != USB_OTG_FS) && (hc->speed == USB_OTG_SPEED_HIGH)) { if((dma == 0) && (hc->do_ping == 1)) @@ -1483,8 +1484,10 @@ USBx_HC(hc->ch_num)->HCCHAR |= (is_oddframe << 29); /* Set host channel enable */ - USBx_HC(hc->ch_num)->HCCHAR &= ~USB_OTG_HCCHAR_CHDIS; - USBx_HC(hc->ch_num)->HCCHAR |= USB_OTG_HCCHAR_CHENA; + tmpreg = USBx_HC(hc->ch_num)->HCCHAR; + tmpreg &= ~USB_OTG_HCCHAR_CHDIS; + tmpreg |= USB_OTG_HCCHAR_CHENA; + USBx_HC(hc->ch_num)->HCCHAR = tmpreg; if (dma == 0) /* Slave mode */ { @@ -1611,13 +1614,16 @@ HAL_StatusTypeDef USB_DoPing(USB_OTG_GlobalTypeDef *USBx , uint8_t ch_num) { uint8_t num_packets = 1; + uint32_t tmpreg = 0; USBx_HC(ch_num)->HCTSIZ = ((num_packets << 19) & USB_OTG_HCTSIZ_PKTCNT) |\ USB_OTG_HCTSIZ_DOPING; /* Set host channel enable */ - USBx_HC(ch_num)->HCCHAR &= ~USB_OTG_HCCHAR_CHDIS; - USBx_HC(ch_num)->HCCHAR |= USB_OTG_HCCHAR_CHENA; + tmpreg = USBx_HC(ch_num)->HCCHAR; + tmpreg &= ~USB_OTG_HCCHAR_CHDIS; + tmpreg |= USB_OTG_HCCHAR_CHENA; + USBx_HC(ch_num)->HCCHAR = tmpreg; return HAL_OK; }