Skip to content

Commit c9309c1

Browse files
committed
Support for STM32F1 with USB_OTG
1 parent c868eb2 commit c9309c1

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: system/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_ll_usb.h

+2
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ typedef struct
160160
uint32_t xfer_len; /*!< Current transfer length */
161161

162162
uint32_t xfer_count; /*!< Partial transfer length in case of multi packet transfer */
163+
164+
uint16_t pending; /*!, Fact, that double buffering transfer have pended data */
163165
}USB_OTG_EPTypeDef;
164166

165167
typedef struct

Diff for: system/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.c

+10-1
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,17 @@
110110
/** @defgroup PCD_Private_Functions PCD Private Functions
111111
* @{
112112
*/
113+
113114
#if defined (USB_OTG_FS)
114115
static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t epnum);
115116
#endif /* USB_OTG_FS */
116117

117118
#if defined (USB)
118119
static HAL_StatusTypeDef PCD_EP_ISR_Handler(PCD_HandleTypeDef *hpcd);
119-
static HAL_StatusTypeDef HAL_PCD_EP_ReceiveData(PCD_HandleTypeDef *hpcd, PCD_EPTypeDef* ep)
120120
#endif /* USB */
121+
122+
static HAL_StatusTypeDef HAL_PCD_EP_ReceiveData(PCD_HandleTypeDef *hpcd, PCD_EPTypeDef* ep);
123+
121124
/**
122125
* @}
123126
*/
@@ -1180,6 +1183,12 @@ static HAL_StatusTypeDef PCD_WriteEmptyTxFifo(PCD_HandleTypeDef *hpcd, uint32_t
11801183

11811184
return HAL_OK;
11821185
}
1186+
1187+
HAL_StatusTypeDef HAL_PCD_EP_ReceiveData(PCD_HandleTypeDef *hpcd, PCD_EPTypeDef* ep)
1188+
{
1189+
USB_EPStartXfer(hpcd->Instance, ep);
1190+
}
1191+
11831192
#endif /* USB_OTG_FS */
11841193

11851194
#if defined (USB)

0 commit comments

Comments
 (0)